mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
attempt to dploy branches to unique verion name
This commit is contained in:
18
.circleci/adjust-pom-version.sh
Executable file
18
.circleci/adjust-pom-version.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -z "$CIRCLE_BRANCH" ]; then
|
||||||
|
echo "Error: env var CIRCLE_BRANCH was not set."
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$CIRCLE_BRANCH" == "dev" ] || [ "$CIRCLE_BRANCH" == "staging" ] || [ "$CIRCLE_BRANCH" == "main" ]; then
|
||||||
|
echo "On a primary branch [$CIRCLE_BRANCH] - will not edit the pom version.";
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
SLUG=$(echo $CIRCLE_BRANCH | sed 's/[^a-zA-Z0-9]/-/g')
|
||||||
|
POM=$(dirname $0)/../pom.xml
|
||||||
|
|
||||||
|
echo "Updating $POM <revision> to: $SLUG-SNAPSHOT"
|
||||||
|
sed -i "s/<revision>.*/<revision>$SLUG-SNAPSHOT<\/revision>/" $POM
|
||||||
|
git diff $POM
|
@ -82,6 +82,10 @@ commands:
|
|||||||
mvn_jar_deploy:
|
mvn_jar_deploy:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
- run:
|
||||||
|
name: Adjust pom version
|
||||||
|
command: |
|
||||||
|
.circleci/adjust-pom-version.sh
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- v1-dependencies-{{ checksum "pom.xml" }}
|
- v1-dependencies-{{ checksum "pom.xml" }}
|
||||||
|
Reference in New Issue
Block a user