version-is-release
1 #!/bin/bash 2 # 3 # This script checks if the current version (HEAD) is an official release. 4 # If so, the program returns with an exit code of 0 (True). If it is not a 5 # release, the program returns an exit code other than 0 (False). 6 # 7 # HEAD is an official release if there exists a tag that points to it and 8 # that is signed by the release manager's key. 9 # 10 11 if [ ! -z "$EMC2_HOME" ]; then 12 source $EMC2_HOME/scripts/githelper.sh 13 else 14 source $(git rev-parse --show-toplevel)/scripts/githelper.sh 15 fi 16 17 githelper $1 18 if [ -z "$GIT_TAG" ]; then 19 # no signed tags found 20 echo "no" 21 exit 1 22 fi 23 24 TAGGED_REV=$(git rev-parse $GIT_TAG^{commit}) 25 HEAD_REV=$(git rev-parse HEAD) 26 27 if [ "$TAGGED_REV" == "$HEAD_REV" ]; then 28 echo "yes" 29 exit 0 30 fi 31 32 echo "no" 33 exit 1 34