go_rc.sh 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/bin/bash
  2. #
  3. # Automatically tag the first rc for a new point release
  4. #
  5. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
  6. . $SCRIPT_DIR/parse_cmake.sh
  7. . $SCRIPT_DIR/parse_hpcc_chart.sh
  8. if [ -e pom.xml ] ; then
  9. . $SCRIPT_DIR/parse_hpcc_pom.sh
  10. fi
  11. sync_git
  12. parse_cmake
  13. if [ "$HPCC_MATURITY" = "closedown" ] ; then
  14. if (( "$HPCC_POINT" % 2 != 1 )) ; then
  15. if [ "$HPCC_POINT" = "0" ] ; then
  16. # special case when creating new minor release
  17. NEW_POINT=0
  18. if (( "$HPCC_MINOR" % 2 == 1 )) ; then
  19. NEW_MINOR=$((HPCC_MINOR+1))
  20. else
  21. echo "A closedown version should have an odd point or minor version to create a new rc"
  22. exit 2
  23. fi
  24. else
  25. echo "A closedown version should have an odd point version to create a new rc"
  26. exit 2
  27. fi
  28. else
  29. NEW_POINT=$((HPCC_POINT+1))
  30. NEW_MINOR=$HPCC_MINOR
  31. fi
  32. if [ "$GIT_BRANCH" != "candidate-$HPCC_MAJOR.$NEW_MINOR.x" ]; then
  33. echo "Current branch should be candidate-$HPCC_MAJOR.$NEW_MINOR.x"
  34. exit 2
  35. fi
  36. doit "git checkout -b candidate-$HPCC_MAJOR.$NEW_MINOR.$NEW_POINT"
  37. doit "git checkout $GIT_BRANCH"
  38. doit "git submodule update --init --recursive"
  39. update_version_file closedown $((NEW_POINT+1)) 0 $NEW_MINOR
  40. if [ -e helm/hpcc/Chart.yaml ] ; then
  41. update_chart_file helm/hpcc/Chart.yaml closedown $HPCC_POINT $NEW_SEQUENCE
  42. fi
  43. doit "git add $VERSIONFILE"
  44. doit "git commit -s -m \"Split off $HPCC_MAJOR.$NEW_MINOR.$NEW_POINT\""
  45. doit "git push $REMOTE"
  46. GIT_BRANCH=candidate-$HPCC_MAJOR.$NEW_MINOR.$NEW_POINT
  47. doit "git checkout $GIT_BRANCH"
  48. doit "git submodule update --init --recursive"
  49. NEW_SEQUENCE=1
  50. else
  51. if [ "$HPCC_MATURITY" != "rc" ] ; then
  52. echo "Current branch should have closedown or rc maturity"
  53. exit 2
  54. fi
  55. if [ "$GIT_BRANCH" != "candidate-$HPCC_MAJOR.$HPCC_MINOR.$HPCC_POINT" ]; then
  56. echo "Current branch should be candidate-$HPCC_MAJOR.$HPCC_MINOR.$HPCC_POINT"
  57. exit 2
  58. fi
  59. NEW_POINT=$HPCC_POINT
  60. NEW_MINOR=$HPCC_MINOR
  61. NEW_SEQUENCE=$((HPCC_SEQUENCE+1))
  62. fi
  63. update_version_file rc $NEW_POINT $NEW_SEQUENCE $NEW_MINOR
  64. if [ -e helm/hpcc/Chart.yaml ] ; then
  65. update_chart_file helm/hpcc/Chart.yaml rc $NEW_POINT $NEW_SEQUENCE
  66. doit "git add helm/hpcc/Chart.yaml"
  67. fi
  68. HPCC_MATURITY=rc
  69. HPCC_SEQUENCE=$NEW_SEQUENCE
  70. HPCC_MINOR=$NEW_MINOR
  71. HPCC_POINT=$NEW_POINT
  72. set_tag
  73. # Commit the change
  74. doit "git add $VERSIONFILE"
  75. doit "git commit -s -m \"$HPCC_NAME $HPCC_SHORT_TAG Release Candidate $HPCC_SEQUENCE\""
  76. doit "git push $REMOTE $GIT_BRANCH $FORCE"
  77. # tag it
  78. do_tag
  79. if [ -e helm/hpcc/Chart.yaml ] ; then
  80. # We publish any tagged version of helm chart to the helm-chart repo
  81. # but only copy helm chart sources across for "latest stable" version
  82. HPCC_DIR="$( pwd )"
  83. pushd ../helm-chart 2>&1 > /dev/null
  84. doit "git fetch $REMOTE"
  85. doit "git checkout master"
  86. doit "git merge --ff-only $REMOTE/master"
  87. doit "git submodule update --init --recursive"
  88. HPCC_PROJECTS=hpcc-helm
  89. HPCC_NAME=HPCC
  90. cd docs
  91. doit "helm package ${HPCC_DIR}/helm/hpcc/"
  92. doit "helm repo index . --url https://hpcc-systems.github.io/helm-chart"
  93. doit "git add *.tgz"
  94. doit "git commit -a -s -m \"$HPCC_NAME Helm Charts $HPCC_SHORT_TAG Release Candidate $HPCC_SEQUENCE\""
  95. doit "git push $REMOTE master $FORCE"
  96. popd
  97. fi