Enable the release dry-run when DRY_RUN is set to true|TRUE
Simplify the management and propagation of the DRY_RUN variable
and allow to use a direct boolean to express the will to run
a dry-run release.
Change-Id: Ic042aed6380cf07fc7b76a382fad5dca30bd9664
diff --git a/jenkins-docker/agent-release/gerrit-release.sh b/jenkins-docker/agent-release/gerrit-release.sh
index 21d54d3..34e00a6 100755
--- a/jenkins-docker/agent-release/gerrit-release.sh
+++ b/jenkins-docker/agent-release/gerrit-release.sh
@@ -29,7 +29,7 @@
echo "* OSSHR_TOKEN:"
echo " API Token used to upload artifacts to Maven Central"
echo "* DRY_RUN:"
- echo " When set do any value, dry-run of the release process, without pushing changes or tags"
+ echo " When set to 'true' or 'TRUE', dry-run of the release process, without pushing changes or tags"
echo ""
exit 1
fi
@@ -110,7 +110,7 @@
git commit -a -m 'Set version to '$version'
Release-Notes: skip'
-test $DRY_RUN || git push origin HEAD:refs/for/"$branch"
+test $DRY_RUN = true || test $DRY_RUN = TRUE || git push origin HEAD:refs/for/"$branch"
git tag -f -s -m "v$version" "v$version"
git submodule foreach 'if [ "$path" != "modules/jgit" ]; then git tag -f -s -m "v$version" "v$version"; fi'
@@ -183,7 +183,7 @@
git commit -a -m 'Set version to '$nextversion'
Release-Notes: skip'
-test $DRY_RUN || git push origin HEAD:refs/for/"$branch"
+test $DRY_RUN = true || test $DRY_RUN = TRUE || git push origin HEAD:refs/for/"$branch"
popd
echo "Release completed"