mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-17 12:50:43 +00:00
Updates to work with branch-specific maven deployments in/with circleci [skip ci]
This commit is contained in:
23
.circleci/adjust-pom-version.sh
Executable file
23
.circleci/adjust-pom-version.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -z "$CIRCLE_BRANCH" ] && [ -z "$CIRCLE_TAG" ]; then
|
||||||
|
echo "Error: env vars CIRCLE_BRANCH and CIRCLE_TAG were 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
|
||||||
|
|
||||||
|
if [ -n "$CIRCLE_BRANCH" ]; then
|
||||||
|
SLUG=$(echo $CIRCLE_BRANCH | sed 's/[^a-zA-Z0-9]/-/g')
|
||||||
|
else
|
||||||
|
SLUG=$(echo $CIRCLE_TAG | sed 's/^snapshot-//g')
|
||||||
|
fi
|
||||||
|
|
||||||
|
POM=$(dirname $0)/../pom.xml
|
||||||
|
|
||||||
|
echo "Updating $POM <revision> to: $SLUG-SNAPSHOT"
|
||||||
|
sed -i "s/<revision>.*/<revision>$SLUG-SNAPSHOT<\/revision>/" $POM
|
||||||
|
git diff $POM
|
@ -71,6 +71,10 @@ commands:
|
|||||||
mvn_deploy:
|
mvn_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