go_gold.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. #
  3. # Automatically tag an existing release candidate build as gold
  4. #
  5. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
  6. . $SCRIPT_DIR/parse_cmake.sh
  7. if [ -e pom.xml ] ; then
  8. . $SCRIPT_DIR/parse_hpcc_pom.sh
  9. fi
  10. sync_git
  11. parse_cmake
  12. NEW_SEQUENCE=1
  13. if [ "$HPCC_MATURITY" != "rc" ] ; then
  14. if [ "$HPCC_MATURITY" = "release" ] ; then
  15. NEW_SEQUENCE=$((HPCC_SEQUENCE+1))
  16. if [ -z "$RETAG" ] ; then
  17. echo "Current version is already at release level. Specify --retag to create $HPCC_MAJOR.$HPCC_MINOR.$HPCC_POINT-$NEW_SEQUENCE"
  18. exit 2
  19. fi
  20. else
  21. echo "Current version should be at rc level to go gold"
  22. exit 2
  23. fi
  24. fi
  25. if (( "$HPCC_POINT" % 2 == 1 )) ; then
  26. echo "Current version should have even point version to go gold"
  27. exit 2
  28. fi
  29. if [ "$GIT_BRANCH" != "candidate-$HPCC_MAJOR.$HPCC_MINOR.$HPCC_POINT" ]; then
  30. echo "Current branch should be candidate-$HPCC_MAJOR.$HPCC_MINOR.$HPCC_POINT"
  31. exit 2
  32. fi
  33. for f in ${HPCC_PROJECT}; do
  34. set_tag $f
  35. if [ $(git rev-parse HEAD) != $(git rev-parse $HPCC_LONG_TAG) ] ; then
  36. if [ -z "$IGNORE" ] ; then
  37. git diff $HPCC_LONG_TAG
  38. echo "There are changes on this branch since $HPCC_LONG_TAG. Use --ignore if you still want to tag Gold"
  39. exit 2
  40. fi
  41. fi
  42. done
  43. update_version_file release $HPCC_POINT $NEW_SEQUENCE
  44. HPCC_MATURITY=release
  45. HPCC_SEQUENCE=$NEW_SEQUENCE
  46. set_tag
  47. # Commit the change
  48. doit "git add $VERSIONFILE"
  49. doit "git commit -s -m \"$HPCC_NAME $HPCC_SHORT_TAG Gold\""
  50. doit "git push $REMOTE $GIT_BRANCH $FORCE"
  51. # tag it
  52. do_tag