MNEMONIC-590: Verify git remote URI of upstream in release .sh
Signed-off-by: Chunyong He <chunyong.he@gmail.com>
diff --git a/bin/release.sh b/bin/release.sh
index 196a149..3c000c6 100755
--- a/bin/release.sh
+++ b/bin/release.sh
@@ -115,6 +115,13 @@
fi
pushd "$MNEMONIC_HOME" || { echo "the environment variable \$MNEMONIC_HOME contains invalid home directory of Mnemonic project."; exit 11; }
+if git remote get-url --push upstream | grep -q "apache/mnemonic"; then
+ echo "Upstream push URL: $(git remote get-url --push upstream)"
+else
+ echo "Upstream push URL is not set correctly, please find one in https://github.com/apache/mnemonic"
+ exit 25;
+fi
+
[[ -n "$(git status --porcelain)" ]] &&
echo "please commit all changes first." && exit 20
@@ -187,7 +194,7 @@
else
echo "Cannot find the revision of tag ${CANDIDATE_TAG_NAME}."; exit 230;
fi
- git tag -s ${RELEASE_TAG_NAME} -m "A release candidate ${RELEASE_TAG_NAME}" ${REVISION_ID} ||
+ git tag -s ${RELEASE_TAG_NAME} -m "A release ${RELEASE_TAG_NAME}" ${REVISION_ID} ||
{ echo "Tagging with signing failed"; exit 240; }
echo "Push the effective release and bump version to upstream."