From 971f70df0dc4ed5f9320d231f290d0e17e4cb7ab Mon Sep 17 00:00:00 2001 From: liamfallon Date: Thu, 20 Oct 2022 11:52:08 +0100 Subject: [PATCH] Make tag specification mandatory on release data Also upgrades apache commons text. Issue-ID: POLICY-4045 Change-Id: Id93f9f92864403eecc198325f6f9dc8083532aab Signed-off-by: liamfallon --- integration/pom.xml | 15 ++++++++++---- .../src/main/scripts/release/releasePhase.sh | 5 ++--- integration/src/main/scripts/release/updateRefs.sh | 24 +++++++++++++--------- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/integration/pom.xml b/integration/pom.xml index 6126bfcc..78251e54 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -844,14 +844,19 @@ ${version.netty} - + + + org.apache.commons + commons-lang3 + 3.12.0 + + org.apache.commons commons-lang3 3.12.0 - commons-io commons-io @@ -860,16 +865,18 @@ org.apache.commons - commons-vfs2 - 2.8.0 + commons-text + 1.10.0 + com.googlecode.json-simple json-simple 1.1.1 + com.github.docker-java docker-java-core diff --git a/integration/src/main/scripts/release/releasePhase.sh b/integration/src/main/scripts/release/releasePhase.sh index 789e7f18..f29bbd3d 100755 --- a/integration/src/main/scripts/release/releasePhase.sh +++ b/integration/src/main/scripts/release/releasePhase.sh @@ -391,11 +391,10 @@ release_phase_14() { release_phase_15() { echo "Updating release data file . . ." updateRefs.sh \ - -f \ + -t "$release_data_file_tag" \ -d "$release_data_file" \ -l "$repo_location" \ - -r "policy/parent" \ - -t "$release_data_file_tag" + -r "policy/parent" generateCommit.sh \ -l "$repo_location" \ -r "policy/parent" \ diff --git a/integration/src/main/scripts/release/updateRefs.sh b/integration/src/main/scripts/release/updateRefs.sh index 9ca92e22..19645788 100755 --- a/integration/src/main/scripts/release/updateRefs.sh +++ b/integration/src/main/scripts/release/updateRefs.sh @@ -55,8 +55,8 @@ usage() echo " -o - update policy/drools-pdp references" echo " -x - update policy/apex-pdp references" echo " -k - update docker base images in Dockerfiles" - echo " -f - update release data in policy parent" - echo " -t tag - tag the release data file with the given tag" + echo " -t tag - update release data in policy parent and" + echo " tag the release data file with the given tag" echo " -s - update release references to snapshot references," echo " if omitted, snapshot references are updated to release references" echo "" @@ -78,9 +78,9 @@ update_drools_pdp=false update_apex_pdp=false update_snapshot=false update_docker=false -update_file=false +update_release_file=false -while getopts "hd:l:r:pcmoxkft:s" opt +while getopts "hd:l:r:pcmoxkt:s" opt do case $opt in h) @@ -113,11 +113,9 @@ do k) update_docker=true ;; - f) - update_file=true - ;; t) - release_data_file_tag="$OPTARG"_ + update_release_file=true + release_data_file_tag="$OPTARG" ;; s) update_snapshot=true @@ -165,6 +163,12 @@ then exit 1 fi +if [ "$update_release_file" = true ] && [ -z "$release_data_file_tag" ] +then + echo "tag not specified on -t flag" + exit 1 +fi + # shellcheck disable=SC2034 # shellcheck disable=SC2046 read -r parent_repo \ @@ -457,7 +461,7 @@ then fi fi -if [ "$update_file" = true ] +if [ "$update_release_file" = true ] then if [ ! "$target_repo" = "policy/parent" ] then @@ -465,7 +469,7 @@ then exit 1 fi - release_data_file_name="$release_data_file_tag$release_data_file" + release_data_file_name="$release_data_file_tag"_"$release_data_file" echo \ "updating release data at" \ -- 2.16.6