Fix latest_release hash test
Obtain the version and latest_release tag commit hashes before changing into the cloned repository so that all tagging and pushing happens on the outer repository.
This commit is contained in:
1 parent
b13baccbd2
commit
6a5df80bda
1 file changed
+7
-4
+7
-4
@@ -36,7 +36,9 @@ setup() {
|
||||
esac
|
||||
|
||||
LATEST_TAG_SHA=$(git rev-parse $LATEST_TAG)
|
||||
LATEST_TAG_COMMIT_SHA=$(git rev-list -1 $LATEST_TAG)
|
||||
LATEST_RELEASE_SHA=$(git rev-parse latest_release)
|
||||
LATEST_RELEASE_COMMIT_SHA=$(git rev-list -1 latest_release)
|
||||
VERSION=${LATEST_TAG}
|
||||
# NB does not check that this tag is on master
|
||||
RELEASE_DIR=./releases/$LATEST_TAG
|
||||
@@ -185,8 +187,10 @@ publish() {
|
||||
else
|
||||
echo "** Release draft detected"
|
||||
echo "== Sanity checks"
|
||||
if ! [ $(git rev-list -1 $LATEST_TAG) == $(git rev-list -1 latest_release) ]; then
|
||||
echo -e "\u2757 The tag latest_release does not point to the same commit as $LATEST_TAG"
|
||||
if ! [ "$LATEST_TAG_COMMIT_SHA" == "$LATEST_RELEASE_COMMIT_SHA" ] ; then
|
||||
echo -e "\u2757 The tag latest_release does not point to the same commit as $LATEST_TAG" >&2
|
||||
echo "You may need to" >&2
|
||||
echo -e "\tgit tag -af latest_release $LATEST_TAG" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -195,8 +199,7 @@ publish() {
|
||||
echo -e "\u2757 Tag latest_release is not on GitHub, or is not the same as the local tag" >&2
|
||||
echo -e "\thttps://github.com/$GITHUB_USER/weave/tags" >&2
|
||||
echo "You may need to" >&2
|
||||
echo -e "\tgit tag -af latest_release"
|
||||
echo -e "\tgit push -f git@github.com:$GITHUB_USER/weave latest_release"
|
||||
echo -e "\tgit push -f git@github.com:$GITHUB_USER/weave latest_release" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo '** Sanity checks OK for publishing tag' $LATEST_TAG as $DOCKERHUB_USER/weave:$VERSION
|
||||
|
||||
Reference in new issue
Block a user