aboutsummaryrefslogtreecommitdiffstats
path: root/integration/src/release_scripts
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2022-03-16 14:27:21 +0000
committerliamfallon <liam.fallon@est.tech>2022-03-16 14:27:25 +0000
commit4d071bf628a11c0c5148eed7462c4bdf8443cb3b (patch)
tree57c010d822c7dba258cf73e100b2a6b3e6b7c86e /integration/src/release_scripts
parent794497a6f9c247cb016c776d4b4d7f805db5dadc (diff)
update release scripts for gui apex dependency
policy-gui nas a dependency on apex-pdp that was missed in the earlier versions of the release scripts. Issue-ID: POLICY-3982 Change-Id: Ic729e2a315c7035e47a62255a375058a536ecf9a Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'integration/src/release_scripts')
-rwxr-xr-xintegration/src/release_scripts/bumpSnapshots.sh2
-rwxr-xr-xintegration/src/release_scripts/generateCommit.sh2
-rwxr-xr-xintegration/src/release_scripts/releasePhase.sh33
-rwxr-xr-xintegration/src/release_scripts/updateRefs.sh47
4 files changed, 63 insertions, 21 deletions
diff --git a/integration/src/release_scripts/bumpSnapshots.sh b/integration/src/release_scripts/bumpSnapshots.sh
index d7d22df7..c67e81ff 100755
--- a/integration/src/release_scripts/bumpSnapshots.sh
+++ b/integration/src/release_scripts/bumpSnapshots.sh
@@ -178,7 +178,7 @@ do
mv "$temp_file" "$repo_location/$repo/version.properties"
fi
- updateRefs.sh -pcmos -d "$release_data_file" -l "$repo_location" -r "$repo"
+ updateRefs.sh -pcmoxs -d "$release_data_file" -l "$repo_location" -r "$repo"
if [ "$(git -C "$repo_location/$specified_repo" status | grep '^[ \t]*modified:[ \t]*pom.xml' > /dev/null 2>&1)" = 0 ]
then
diff --git a/integration/src/release_scripts/generateCommit.sh b/integration/src/release_scripts/generateCommit.sh
index 29e600a2..a62cf493 100755
--- a/integration/src/release_scripts/generateCommit.sh
+++ b/integration/src/release_scripts/generateCommit.sh
@@ -20,8 +20,6 @@
# ============LICENSE_END==================================================
#
-set -e
-
SCRIPT_NAME=$(basename "$0")
repo_location="./"
diff --git a/integration/src/release_scripts/releasePhase.sh b/integration/src/release_scripts/releasePhase.sh
index b3f7e0af..920998db 100755
--- a/integration/src/release_scripts/releasePhase.sh
+++ b/integration/src/release_scripts/releasePhase.sh
@@ -247,11 +247,6 @@ release_phase_7() {
-pcmk \
-d "$release_data_file" \
-l "$repo_location" \
- -r "policy/gui"
- updateRefs.sh \
- -pcmk \
- -d "$release_data_file" \
- -l "$repo_location" \
-r "policy/pap"
updateRefs.sh \
-pcmk \
@@ -290,12 +285,6 @@ release_phase_7() {
-m "updated references in the policy/drools-pdp pom"
generateCommit.sh \
-l "$repo_location" \
- -r "policy/gui" \
- -i "$issue_id" \
- -e "update references in policy/gui pom" \
- -m "updated references in the policy/gui pom"
- generateCommit.sh \
- -l "$repo_location" \
-r "policy/pap" \
-i "$issue_id" \
-e "update references in policy/pap pom" \
@@ -316,7 +305,6 @@ release_phase_8() {
releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/clamp -i "$issue_id"
releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/distribution -i "$issue_id"
releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/drools-pdp -i "$issue_id"
- releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/gui -i "$issue_id"
releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/pap -i "$issue_id"
releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/xacml-pdp -i "$issue_id"
echo "Generated artifact release yaml file and commit for repos"
@@ -329,14 +317,13 @@ release_phase_9() {
releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/clamp -i "$issue_id"
releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/distribution -i "$issue_id"
releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/drools-pdp -i "$issue_id"
- releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/gui -i "$issue_id"
releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/pap -i "$issue_id"
releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/xacml-pdp -i "$issue_id"
echo "Generated docker release yaml file and commit for repos"
}
release_phase_10() {
- echo "Updating snapshots for repos, updating references on policy/drools-applications . . ."
+ echo "Updating snapshots for repos, updating references on policy/drools-applications, policy/gui . . ."
bumpSnapshots.sh \
-d "$release_data_file" \
-l "$repo_location" \
@@ -346,33 +333,47 @@ release_phase_10() {
-d "$release_data_file" \
-l "$repo_location" \
-r "policy/drools-applications"
+ updateRefs.sh \
+ -pcmxk \
+ -d "$release_data_file" \
+ -l "$repo_location" \
+ -r "policy/gui"
generateCommit.sh \
-l "$repo_location" \
-r "policy/drools-applications" \
-i "$issue_id" \
-e "update references in policy/drools-applications pom" \
-m "updated references in the policy/drools-applications pom"
- echo "Updated snapshots for repos, updated references on policy/drools-applications"
+ generateCommit.sh \
+ -l "$repo_location" \
+ -r "policy/gui" \
+ -i "$issue_id" \
+ -e "update references in policy/gui pom" \
+ -m "updated references in the policy/gui pom"
+ echo "Updated snapshots for repos, updated references on policy/drools-applications, policy/gui"
}
release_phase_11() {
echo "Generating artifact release yaml file and commit for policy/drools-applications . . ."
releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/drools-applications -i "$issue_id"
+ releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/gui -i "$issue_id"
echo "Generated artifact release yaml file and commit for policy/drools-applications"
}
release_phase_12() {
echo "Generating docker release yaml file and commit for policy/drools-applications . . ."
releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/drools-applications -i "$issue_id"
+ releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/gui -i "$issue_id"
echo "Generated docker release yaml file and commit for policy/drools-applications"
}
release_phase_13() {
- echo "Updating snapshots on policy/drools-applications . . ."
+ echo "Updating snapshots on policy/drools-applications, policy/gui . . ."
bumpSnapshots.sh \
-d "$release_data_file" \
-l "$repo_location" \
-i "$issue_id"
+ echo "Updated snapshots on policy/drools-applications, policy/gui"
}
case "$release_phase" in
diff --git a/integration/src/release_scripts/updateRefs.sh b/integration/src/release_scripts/updateRefs.sh
index 01ea31a0..0f253f97 100755
--- a/integration/src/release_scripts/updateRefs.sh
+++ b/integration/src/release_scripts/updateRefs.sh
@@ -52,6 +52,7 @@ usage()
echo " -c - update policy/common references"
echo " -m - update policy/model references"
echo " -o - update policy/drools-pdp references"
+ echo " -x - update policy/apex-pdp references"
echo " -k - update docker base images in Dockerfiles"
echo " -s - update release references to snapshot references,"
echo " if omitted, snapshot references are updated to release references"
@@ -71,10 +72,11 @@ update_parent=false
update_common=false
update_models=false
update_drools_pdp=false
+update_apex_pdp=false
update_snapshot=false
update_docker=false
-while getopts "hd:l:r:pcmoks" opt
+while getopts "hd:l:r:pcmoxks" opt
do
case $opt in
h)
@@ -101,6 +103,9 @@ do
o)
update_drools_pdp=true
;;
+ x)
+ update_apex_pdp=true
+ ;;
k)
update_docker=true
;;
@@ -197,6 +202,15 @@ read -r drools_pdp_repo \
# shellcheck disable=SC2034
# shellcheck disable=SC2046
+read -r apex_pdp_repo \
+ apex_pdp_latest_released_tag \
+ apex_pdp_latest_snapshot_tag \
+ apex_pdp_changed_files \
+ apex_pdp_docker_images \
+ <<< $(grep policy/apex-pdp "$release_data_file" | tr ',' ' ' )
+
+# shellcheck disable=SC2034
+# shellcheck disable=SC2046
read -r target_repo \
target_latest_released_tag \
target_latest_snapshot_tag \
@@ -353,12 +367,41 @@ then
fi
fi
+if [ "$update_apex_pdp" = true ]
+then
+ if [ "$update_snapshot" = true ]
+ then
+ echo "updating policy apex-pdp reference to $apex_pdp_latest_snapshot_tag on $repo_location/$target_repo . . ."
+ $SED -i \
+ -e "s/<policy.apex-pdp.version>.*<\/policy.apex-pdp.version>/<policy.apex-pdp.version>$apex_pdp_latest_snapshot_tag<\/policy.apex-pdp.version>/" \
+ -e "s/<version.policy.apex-pdp>.*<\/version.policy.apex-pdp>/<version.policy.apex-pdp>$apex_pdp_latest_snapshot_tag<\/version.policy.apex-pdp>/" \
+ "$repo_location/$target_repo/pom.xml"
+ result_code=$?
+ else
+ echo "updating policy apex-pdp reference to $apex_pdp_latest_released_tag on $repo_location/$target_repo . . ."
+ $SED -i \
+ -e "s/<policy.apex-pdp.version>.*<\/policy.apex-pdp.version>/<policy.apex-pdp.version>$apex_pdp_latest_released_tag<\/policy.apex-pdp.version>/" \
+ -e "s/<version.policy.apex-pdp>.*<\/version.policy.apex-pdp>/<version.policy.apex-pdp>$apex_pdp_latest_released_tag<\/version.policy.apex-pdp>/" \
+ "$repo_location/$target_repo/pom.xml"
+ result_code=$?
+ fi
+ if [[ "$result_code" -eq 0 ]]
+ then
+ echo "policy apex-pdp reference updated on $repo_location/$target_repo"
+ else
+ echo "policy apex-pdp reference update failed on $repo_location/$target_repo"
+ exit 1
+ fi
+fi
+
if [ "$update_docker" = true ] && [ "$target_docker_images" != "" ]
then
echo "updating docker base images to version $docker_latest_released_tag on repo $repo_location/$target_repo . . ."
find "$repo_location/$target_repo" \
+ -name '*Docker*'
+ find "$repo_location/$target_repo" \
-name '*Docker*' \
- -exec $SED -r -i "s/^(FROM onap\/policy-j[d|r][k|e]-alpine:)2.3.1$/\1$docker_latest_released_tag/" {} \;
+ -exec $SED -r -i "s/^(FROM onap\/policy-j[d|r][k|e]-alpine:)[0-9]*.[0-9]*.[0-9]*$/\1$docker_latest_released_tag/" {} \;
result_code=$?
if [[ "$result_code" -eq 0 ]]
then