release/deploy-github: add rudimentary checks for tag existence
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
4c3ccb42cd
commit
f9c310e93a
1 changed files with 8 additions and 0 deletions
|
@ -4,6 +4,14 @@ trap 'exit 1' SIGINT SIGTERM
|
||||||
|
|
||||||
[ -z "$(command -v hub)" ] && { echo "hub not installed; aborting!"; exit 1; }
|
[ -z "$(command -v hub)" ] && { echo "hub not installed; aborting!"; exit 1; }
|
||||||
[ -z "${1}" ] && { echo "No tag specified!"; exit 1; }
|
[ -z "${1}" ] && { echo "No tag specified!"; exit 1; }
|
||||||
|
found_tag=
|
||||||
|
git tag -l | while read -r tag; do
|
||||||
|
if [ "$tag" == "${1}" ]; then
|
||||||
|
found_tag=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
[ -z "${found_tag}" ] && { echo "Cannot find tag ${1} in the repository"; exit 1; }
|
||||||
prev_ref="$(git rev-parse --abbrev-ref HEAD)"
|
prev_ref="$(git rev-parse --abbrev-ref HEAD)"
|
||||||
git checkout "${1}"
|
git checkout "${1}"
|
||||||
gradle clean bundleRelease assembleRelease
|
gradle clean bundleRelease assembleRelease
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue