From 4228304ec6e290dc3dddd79f05c82dbdfb17b068 Mon Sep 17 00:00:00 2001 From: Wikum Weerakutti Date: Mon, 11 Nov 2024 17:47:10 +0900 Subject: [PATCH] Adding a variable to set the next development version on Bamboo --- bamboo-specs/bamboo.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bamboo-specs/bamboo.yml b/bamboo-specs/bamboo.yml index e933f74cbd0..1333a4f2af6 100644 --- a/bamboo-specs/bamboo.yml +++ b/bamboo-specs/bamboo.yml @@ -257,6 +257,7 @@ Release: set +x export OMRS_VERSION=${bamboo.maven.release.version} + export NEW_DEV_VERSION=${maven.development.version} export IMAGE=${bamboo.docker.image.name}:${OMRS_VERSION} export DEV_IMAGE=${bamboo.docker.image.name}:${OMRS_VERSION}-dev export BUILD_IMAGE=${bamboo.docker.image.id} @@ -299,8 +300,16 @@ Release: ( echo "Updating the main branch to a new SNAPSHOT version" git push - docker run --rm -v m2-repo:/root/.m2/repository -v $(pwd):/openmrs_core \ - ${DEV_IMAGE} mvn versions:set -DnextSnapshot=true -DgenerateBackupPoms=false + + echo "Setting the next development version" + + if [ -z "$NEW_DEV_VERSION" ]; then + docker run --rm -v m2-repo:/root/.m2/repository -v $(pwd):/openmrs_core \ + ${DEV_IMAGE} mvn versions:set -DnextSnapshot=true -DgenerateBackupPoms=false + else + docker run --rm -v m2-repo:/root/.m2/repository -v $(pwd):/openmrs_core \ + ${DEV_IMAGE} mvn versions:set -DnewVersion=${NEW_DEV_VERSION} -DgenerateBackupPoms=false + fi git commit -am "Setting new SNAPSHOT version" git push