浏览代码

HPCC-26537 Release script doesn't handle a new minor release well

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 年之前
父节点
当前提交
8770495016
共有 3 个文件被更改,包括 54 次插入18 次删除
  1. 41 7
      cmake_modules/go_rc.sh
  2. 4 7
      cmake_modules/parse_cmake.sh
  3. 9 4
      cmake_modules/parse_hpcc_pom.sh

+ 41 - 7
cmake_modules/go_rc.sh

@@ -14,7 +14,7 @@ fi
 
 sync_git
 parse_cmake
-if [ "$HPCC_MATURITY" = "closedown" ] ; then
+if [ "$HPCC_MATURITY" = "closedown" ] || [ "$HPCC_MATURITY" = "trunk" ] ; then
   if (( "$HPCC_POINT" % 2 != 1 )) ; then
     if [ "$HPCC_POINT" = "0" ] ; then
       # special case when creating new minor release
@@ -33,19 +33,36 @@ if [ "$HPCC_MATURITY" = "closedown" ] ; then
     NEW_POINT=$((HPCC_POINT+1))
     NEW_MINOR=$HPCC_MINOR
   fi
-  if [ "$GIT_BRANCH" != "candidate-$HPCC_MAJOR.$NEW_MINOR.x" ]; then
-    echo "Current branch should be candidate-$HPCC_MAJOR.$NEW_MINOR.x"
-    exit 2
+  if [ "$HPCC_MATURITY" = "closedown" ] ; then
+    if [ "$GIT_BRANCH" != "candidate-$HPCC_MAJOR.$NEW_MINOR.x" ]; then
+      echo "Current branch should be candidate-$HPCC_MAJOR.$NEW_MINOR.x"
+      exit 2
+    fi
+  else
+    if [ "$GIT_BRANCH" != "master" ]; then
+      echo "Current branch should be master"
+      exit 2
+    fi
+  fi
+  if [ "$GIT_BRANCH" = "master" ]; then
+    doit "git checkout -b candidate-$HPCC_MAJOR.$NEW_MINOR.x"
   fi
   doit "git checkout -b candidate-$HPCC_MAJOR.$NEW_MINOR.$NEW_POINT"
   doit "git checkout $GIT_BRANCH"
   doit "git submodule update --init --recursive"
-  update_version_file closedown $((NEW_POINT+1)) 0 $NEW_MINOR
+  if [ "$GIT_BRANCH" = "master" ]; then
+    TRUNK_POINT=0
+    TRUNK_MINOR=$((NEW_MINOR+1))
+  else
+    TRUNK_POINT=$((NEW_POINT+1))
+    TRUNK_MINOR=$NEW_MINOR
+  fi
+  update_version_file $HPCC_MATURITY $TRUNK_POINT 0 $TRUNK_MINOR
   if [ -e helm/hpcc/Chart.yaml ] ; then
-    update_chart_file helm/hpcc/Chart.yaml closedown $((NEW_POINT+1)) 0 $NEW_MINOR 
+    update_chart_file helm/hpcc/Chart.yaml $HPCC_MATURITY $TRUNK_POINT 0 $TRUNK_MINOR 
     doit "git add helm/hpcc/Chart.yaml"
     for f in helm/hpcc/templates/* ; do
-      update_chart_file $f closedown $((NEW_POINT+1)) 0 $NEW_MINOR 
+      update_chart_file $f $HPCC_MATURITY $TRUNK_POINT 0 $TRUNK_MINOR 
     if [ "$CHART_CHANGED" != "0" ] ; then
         doit "git add $f"
       fi
@@ -54,6 +71,23 @@ if [ "$HPCC_MATURITY" = "closedown" ] ; then
   doit "git add $VERSIONFILE"
   doit "git commit -s -m \"Split off $HPCC_MAJOR.$NEW_MINOR.$NEW_POINT\""
   doit "git push $REMOTE"
+  if [ "$GIT_BRANCH" = "master" ]; then
+    doit "git checkout candidate-$HPCC_MAJOR.$NEW_MINOR.x"
+    update_version_file closedown 0 0 $NEW_MINOR
+    if [ -e helm/hpcc/Chart.yaml ] ; then
+      update_chart_file helm/hpcc/Chart.yaml closedown 0 0 $NEW_MINOR 
+      doit "git add helm/hpcc/Chart.yaml"
+      for f in helm/hpcc/templates/* ; do
+        update_chart_file $f closedown 0 0 $NEW_MINOR 
+        if [ "$CHART_CHANGED" != "0" ] ; then
+          doit "git add $f"
+        fi
+      done
+    fi
+    doit "git add $VERSIONFILE"
+    doit "git commit -s -m \"Split off $HPCC_MAJOR.$NEW_MINOR.$NEW_POINT\""
+    doit "git push $REMOTE"
+  fi
   GIT_BRANCH=candidate-$HPCC_MAJOR.$NEW_MINOR.$NEW_POINT
   doit "git checkout $GIT_BRANCH"
   doit "git submodule update --init --recursive"

+ 4 - 7
cmake_modules/parse_cmake.sh

@@ -16,9 +16,6 @@ IGNORE=
 RETAG=
 VERBOSE=
 VERSIONFILE=version.cmake
-if [ ! -f $VERSIONFILE ]; then
-  VERSIONFILE=$SCRIPT_DIR/../version.cmake
-fi
 
 POSITIONAL=()
 while [[ $# -gt 0 ]]
@@ -66,10 +63,6 @@ if [ "$#" -ge 1 ] ; then
   VERSIONFILE=$1
   shift 1
 fi
-if [ ! -f $VERSIONFILE ]; then
-  echo "File $VERSIONFILE not found"
-  exit 2
-fi
 
 GIT_BRANCH=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD)
 
@@ -87,6 +80,10 @@ function extract()
 
 function parse_cmake()
 {
+    if [ ! -f $VERSIONFILE ]; then
+      echo "File $VERSIONFILE not found"
+      exit 2
+    fi
     extract $VERSIONFILE HPCC_NAME
     extract $VERSIONFILE HPCC_PROJECT
     extract $VERSIONFILE HPCC_MAJOR

+ 9 - 4
cmake_modules/parse_hpcc_pom.sh

@@ -54,13 +54,16 @@ function parse_cmake()
     # branch on gold release
     HPCC_MATURITY=release
   elif [ "$HPCC_MATURITY" == "SNAPSHOT" ] ; then
-    if (( "$HPCC_POINT" % 2 != 1 )) ; then
-      HPCC_MATURITY=rc
+    if (( "$HPCC_MINOR" % 2 == 1 )) ; then
+      HPCC_MATURITY=trunk
     else
-      HPCC_MATURITY=closedown
+      if (( "$HPCC_POINT" % 2 != 1 )) ; then
+        HPCC_MATURITY=rc
+      else
+        HPCC_MATURITY=closedown
+      fi
     fi
   fi
-
 }
 
 function set_tag()
@@ -85,6 +88,8 @@ function update_version_file()
     if [ -z "$_new_minor" ] ; then
       _new_minor=$HPCC_MINOR
     fi
+    if [ "$_new_maturity" == "trunk" ]; then
+      _new_maturity=-SNAPSHOT
     if [ "$_new_maturity" == "rc" ]; then
       _new_maturity=-SNAPSHOT
     elif [ "$_new_maturity" == "closedown" ]; then