aboutsummaryrefslogtreecommitdiffstats
path: root/integration/src/main/scripts/release/newReleaseSnapshots.sh
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2023-05-25 12:07:06 +0100
committerLiam Fallon <liam.fallon@est.tech>2023-05-25 11:09:34 +0000
commit4453ae3019777a432fb78d11c7a5d6a52b0859e9 (patch)
treef85ffd8db650b7116f7be564036803ed29a9ebca /integration/src/main/scripts/release/newReleaseSnapshots.sh
parent74de70640db8fa98358f755f2301cea9d7883a06 (diff)
Update release scripts to support major releases
Added a -m flag to the newReleaseSnapshots.sh script to support a major version change. Added a script to clean up references when they get out of sync. Issue-ID: POLICY-4662 Change-Id: I30e11e41419b8b79ac03a00d6f4a05d8020a35ea Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'integration/src/main/scripts/release/newReleaseSnapshots.sh')
-rwxr-xr-xintegration/src/main/scripts/release/newReleaseSnapshots.sh25
1 files changed, 20 insertions, 5 deletions
diff --git a/integration/src/main/scripts/release/newReleaseSnapshots.sh b/integration/src/main/scripts/release/newReleaseSnapshots.sh
index 3e4ab2bb..b80459b2 100755
--- a/integration/src/main/scripts/release/newReleaseSnapshots.sh
+++ b/integration/src/main/scripts/release/newReleaseSnapshots.sh
@@ -4,7 +4,7 @@
# ============LICENSE_START================================================
# ONAP
# =========================================================================
-# Copyright (C) 2022 Nordix Foundation.
+# Copyright (C) 2022-2023 Nordix Foundation.
# =========================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -63,6 +63,7 @@ usage()
echo " -d data_file - the policy release data file to use, defaults to '$release_data_file'"
echo " -l location - the location of the policy framework repos on the file system,"
echo " defaults to '$repo_location'"
+ echo " -m - update snapshots for a major release, default is to update for a minor release"
echo " -i issue-id - issue ID in the format POLICY-nnnn"
echo ""
echo " examples:"
@@ -72,7 +73,9 @@ usage()
exit 255;
}
-while getopts "hd:l:i:" opt
+major_release=false
+
+while getopts "hmd:l:i:" opt
do
case $opt in
h)
@@ -87,6 +90,9 @@ do
i)
issue_id=$OPTARG
;;
+ m)
+ major_release=true
+ ;;
\?)
usage
exit 1
@@ -159,9 +165,17 @@ do
minor_version=$(echo "$latest_released_tag" | $SED -E 's/^[0-9]*\.([0-9]*)\.[0-9]*$/\1/')
patch_version=$(echo "$next_release_version" | $SED -E 's/^[0-9]*\.[0-9]*\.([0-9]*)$/\1/')
# shellcheck disable=SC2004
- new_minor_version=$(($minor_version+1))
- new_snapshot_tag="$major_version"."$new_minor_version".0-SNAPSHOT
+ if $major_release
+ then
+ new_major_version=$(($major_version+1))
+ new_minor_version=0
+ else
+ new_major_version=$major_version
+ new_minor_version=$(($minor_version+1))
+ fi
+
+ new_snapshot_tag="$new_major_version"."$new_minor_version".0-SNAPSHOT
echo "updating snapshot version and references of repo $repo to $new_snapshot_tag . . ."
mvn -f "$repo_location/$repo" \
@@ -172,6 +186,7 @@ do
echo "set snapshot version of repo $repo in $repo_location/$repo/version.properties"
$SED \
+ -e "s/major=$major_version/minor=$new_major_version/" \
-e "s/minor=$minor_version/minor=$new_minor_version/" \
-e "s/patch=$patch_version/patch=0/" \
"$repo_location/$repo/version.properties" \
@@ -181,7 +196,7 @@ do
updateRefs.sh -pcmoxs -d "$release_data_file" -l "$repo_location" -r "$repo"
generateCommit.sh \
- -l "$repo_location" \
+ -l "$repo_location" \
-r "$repo" \
-i "$issue_id" \
-e "Set snapshot and/or references of $repo for new release" \