Feedback from code review

This commit is contained in:
2024-11-22 10:21:22 -06:00
parent cfeb71aa2f
commit 6e91149b0a
2 changed files with 22 additions and 5 deletions

View File

@ -1,13 +1,24 @@
#!/bin/bash #!/bin/bash
## todo - some version of: ############################################################################
## - main (or -version tag?) noop? ## adjust-pom.version.sh
## - dev ... replace -SNAPSHOT w/ -${timestamp} ## During CircleCI builds - edit the qqq parent pom.xml, to set the
## - other tags ... replace -SNAPSHOT w/ -${tag}-${timestamp} ## <revision> value such that:
## - feature-branch builds, tagged as snapshot-*, deploy with a version
## number that includes that tag's name (minus the snapshot- part)
## - integration-branch builds deploy with a version number that includes
## the branch name slugified
## - we never deploy -SNAPSHOT versions any more - because we don't believe
## it is ever valid to not know exactly what versions you are getting
## (perhaps because we are too loose with our versioning?)
############################################################################
POM=$(dirname $0)/../pom.xml POM=$(dirname $0)/../pom.xml
echo "On branch: $CIRCLE_BRANCH, tag: $CIRCLE_TAG..." echo "On branch: $CIRCLE_BRANCH, tag: $CIRCLE_TAG..."
######################################################################
## ## only do anything if the committed pom has a -SNAPSHOT version ##
######################################################################
REVISION=$(grep '<revision>' $POM | sed 's/.*<revision>//;s/<.*//'); REVISION=$(grep '<revision>' $POM | sed 's/.*<revision>//;s/<.*//');
echo "<revision> in pom.xml is: $REVISION" echo "<revision> in pom.xml is: $REVISION"
if [ \! $(echo "$REVISION" | grep SNAPSHOT) ]; then if [ \! $(echo "$REVISION" | grep SNAPSHOT) ]; then
@ -15,6 +26,9 @@ if [ \! $(echo "$REVISION" | grep SNAPSHOT) ]; then
exit 0; exit 0;
fi fi
##################################################################################
## ## figure out if we need a SLUG: a snapshot- tag, or an integration/ branch ##
##################################################################################
SLUG="" SLUG=""
if [ $(echo "$CIRCLE_TAG" | grep ^snapshot-) ]; then if [ $(echo "$CIRCLE_TAG" | grep ^snapshot-) ]; then
SLUG=$(echo "$CIRCLE_TAG" | sed "s/^snapshot-//")- SLUG=$(echo "$CIRCLE_TAG" | sed "s/^snapshot-//")-
@ -25,6 +39,9 @@ elif [ $(echo "$CIRCLE_BRANCH" | grep ^integration/) ]; then
echo "Using slug [$SLUG] from branch [$CIRCLE_BRANCH]" echo "Using slug [$SLUG] from branch [$CIRCLE_BRANCH]"
fi fi
################################################################
## ## build the replcaement for -SNAPSHOT, and update the pom ##
################################################################
TIMESTAMP=$(date +%Y%m%d-%H%M%S) TIMESTAMP=$(date +%Y%m%d-%H%M%S)
REPLACEMENT=${SLUG}${TIMESTAMP} REPLACEMENT=${SLUG}${TIMESTAMP}

View File

@ -105,7 +105,7 @@ commands:
- run: - run:
name: Run Maven Jar Deploy name: Run Maven Jar Deploy
command: | command: |
mvn -s .circleci/mvn-settings.xml -T4 flatten:flatten jar:jar deploy:deploy -DuniqueVersion=false mvn -s .circleci/mvn-settings.xml -T4 flatten:flatten jar:jar deploy:deploy
- save_cache: - save_cache:
paths: paths:
- ~/.m2 - ~/.m2