diff --git a/scripts/cleanup_cache.sh b/scripts/cleanup_cache.sh new file mode 100644 index 00000000..7c478e57 --- /dev/null +++ b/scripts/cleanup_cache.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -ev + +find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT" | xargs -r -l rm -rf diff --git a/scripts/init.sh b/scripts/init.sh new file mode 100644 index 00000000..b57d4015 --- /dev/null +++ b/scripts/init.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +echo "=========================== Starting Init Script ===========================" +PS4="\[\e[35m\]+ \[\e[m\]" +set -vex +pushd "$(dirname "${BASH_SOURCE[0]}")/../../" + +# Maven Setup +find "${HOME}/.m2/repository/" -type d -name "*-SNAPSHOT*" | xargs -r -l rm -rf + +# Docker Logins +echo "${DOCKERHUB_PASSWORD}" | docker login -u="${DOCKERHUB_USERNAME}" --password-stdin +echo "${QUAY_PASSWORD}" | docker login -u="${QUAY_USERNAME}" --password-stdin quay.io + +popd +set +vex +echo "=========================== Finishing Init Script ==========================" diff --git a/scripts/maven_release.sh b/scripts/maven_release.sh new file mode 100644 index 00000000..d8ebd580 --- /dev/null +++ b/scripts/maven_release.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +echo "=========================== Starting Release Script ===========================" +PS4="\[\e[35m\]+ \[\e[m\]" +set -vex +pushd "$(dirname "${BASH_SOURCE[0]}")/../../" + +# Use full history for release +git checkout -B "${BRANCH_NAME}" + +# Run the release plugin - with "[skip ci]" in the release commit message +mvn -B \ + "-Darguments=-DskipTests -Dbuild-number=${BUILD_NUMBER}" \ + release:clean release:prepare release:perform \ + -DscmCommentPrefix="[maven-release-plugin][skip ci] " \ + -Dusername="${GIT_USERNAME}" \ + -Dpassword="${GIT_PASSWORD}" \ + -Prelease + +popd +set +vex +echo "=========================== Finishing Release Script ==========================" + diff --git a/scripts/verify_release_tag.sh b/scripts/verify_release_tag.sh new file mode 100644 index 00000000..1c13189b --- /dev/null +++ b/scripts/verify_release_tag.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +echo "=========================== Starting Verify Release Tag Script ===========================" +PS4="\[\e[35m\]+ \[\e[m\]" +set -vex +pushd "$(dirname "${BASH_SOURCE[0]}")/../../" + +# +# Check that the version to be released does not already have a git tag. +# + +POM_VERSION=$(mvn -B -q help:evaluate -Dexpression=project.version -DforceStdout) +printf "POM version: %s\n" "${POM_VERSION}" + +TAG="${POM_VERSION%-SNAPSHOT}" + +if git rev-parse "${TAG}^{tag}" &>/dev/null ; then + echo "The next tag \"${TAG}\" already exists in the git project" + exit 1 +fi + +popd +set +vex +echo "=========================== Finishing Verify Release Tag Script =========================="