From 828191742e62050a29ea286b3ed7c01c67eb137f Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Wed, 15 Feb 2023 18:23:52 -0600 Subject: [PATCH] add release trigger --- scripts/trigger-release-build | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 scripts/trigger-release-build diff --git a/scripts/trigger-release-build b/scripts/trigger-release-build new file mode 100755 index 000000000..c05368f5b --- /dev/null +++ b/scripts/trigger-release-build @@ -0,0 +1,21 @@ +#!/bin/bash +cd mvn-defaults +#set -x +CURRENT_VERSION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout) +RELEASE_VERSION=${CURRENT_VERSION%%-SNAPSHOT} +RELEASE_TAG="${RELEASE_VERSION}-release" +printf "release tag: '%s'\n" "${RELEASE_TAG}" +set -e + +if [ "$1" == "-f" ] +then + git tag -f "${RELEASE_TAG}" \ + && git push -f origin "${RELEASE_TAG}" \ + && printf "force pushed tag %s to origin, triggering build.\n" "${RELEASE_TAG}" +else + git tag "${RELEASE_TAG}" \ + && git push origin "${RELEASE_TAG}" \ + && printf "pushed tag %s to origin, triggering build.\n" "${RELEASE_TAG}" +fi + +