summaryrefslogtreecommitdiffstats
path: root/integration/src/release_scripts/bumpSnapshots.sh
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2022-03-01 21:01:03 +0000
committerliamfallon <liam.fallon@est.tech>2022-03-01 21:05:54 +0000
commitd7d9a664cb6d45b1019f8ac897feac512e5b37e8 (patch)
treeaeda2f2c5b71e61abb81a086e69530b021be6f62 /integration/src/release_scripts/bumpSnapshots.sh
parent006a229e166b5656fd9ba320e2b36d33c7e945a8 (diff)
Update release scripts for branches
Release scripts are updated: - Can now handle releasing on a branch for a maintenance release - startPhase.sh script updated to handle all 13 phases of the release process - Various corrections and bug fixes found during the release - scripts updated to comply with IntelliJ shekkcheck suggestions Issue-ID: POLICY-3835 Change-Id: Ibfa49e4132ca61ae0541600fae5f6814cdf7a409 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'integration/src/release_scripts/bumpSnapshots.sh')
-rwxr-xr-xintegration/src/release_scripts/bumpSnapshots.sh43
1 files changed, 24 insertions, 19 deletions
diff --git a/integration/src/release_scripts/bumpSnapshots.sh b/integration/src/release_scripts/bumpSnapshots.sh
index ced6453c..d7d22df7 100755
--- a/integration/src/release_scripts/bumpSnapshots.sh
+++ b/integration/src/release_scripts/bumpSnapshots.sh
@@ -22,7 +22,7 @@
set -e
-SCRIPT_NAME=`basename $0`
+SCRIPT_NAME=$(basename "$0")
repo_location="./"
release_data_file="./pf_release_data.csv"
@@ -138,11 +138,14 @@ fi
for specified_repo in "${pf_repos[@]}"
do
- read repo \
+ # shellcheck disable=SC2034
+ # shellcheck disable=SC2046
+ read -r repo \
latest_released_tag \
latest_snapshot_tag \
- changed_files docker_images \
- <<< $( grep $specified_repo $release_data_file | tr ',' ' ' )
+ changed_files \
+ docker_images \
+ <<< $(grep "$specified_repo" "$release_data_file" | tr ',' ' ' )
if [ ! "$repo" = "$specified_repo" ]
then
@@ -154,28 +157,30 @@ do
if [ "$latest_released_tag" = "$next_release_version" ]
then
- declare -i major_version=`echo $next_release_version | $SED -E 's/^([0-9]*)\.[0-9]*\.[0-9]*$/\1/'`
- declare -i minor_version=`echo $next_release_version | $SED -E 's/^[0-9]*\.([0-9]*)\.[0-9]*$/\1/'`
- declare -i patch_version=`echo $next_release_version | $SED -E 's/^[0-9]*\.[0-9]*\.([0-9]*)$/\1/'`
- declare -i new_patch_version=$(($patch_version+1))
+ major_version=$(echo "$next_release_version" | $SED -E 's/^([0-9]*)\.[0-9]*\.[0-9]*$/\1/')
+ minor_version=$(echo "$next_release_version" | $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_patch_version=$(($patch_version+1))
new_snapshot_tag="$major_version"."$minor_version"."$new_patch_version"-SNAPSHOT
- echo updating snapshot version and references of repo $repo to $new_snapshot_tag . . .
- mvn -f $repo_location/$repo \
- -DnewVersion=$new_snapshot_tag versions:set \
+ echo "updating snapshot version and references of repo $repo to $new_snapshot_tag . . ."
+ mvn -f "$repo_location/$repo" \
+ "-DnewVersion=$new_snapshot_tag" versions:set \
versions:update-child-modules versions:commit
temp_file=$(mktemp)
- echo updating snapshot version of repo $repo in $repo_location/$repo/version.properties
- $SED -e "s/patch=$patch_version/patch=$new_patch_version/" $repo_location/$repo/version.properties > $temp_file
- mv $temp_file $repo_location/$repo/version.properties
+ echo "updating snapshot version of repo $repo in $repo_location/$repo/version.properties"
+ $SED -e "s/patch=$patch_version/patch=$new_patch_version/" \
+ "$repo_location/$repo/version.properties" > "$temp_file"
+ mv "$temp_file" "$repo_location/$repo/version.properties"
fi
- updateRefs.sh -pcmos -d $release_data_file -l $repo_location -r $repo
+ updateRefs.sh -pcmos -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 ]
+ if [ "$(git -C "$repo_location/$specified_repo" status | grep '^[ \t]*modified:[ \t]*pom.xml' > /dev/null 2>&1)" = 0 ]
then
references_updated=0
else
@@ -190,9 +195,9 @@ do
echo "generating commit to update snapshot version and/or references of repo $repo . . ."
generateCommit.sh \
- -l $repo_location \
- -r $repo \
- -i $issue_id \
+ -l "$repo_location" \
+ -r "$repo" \
+ -i "$issue_id" \
-e "Update snapshot and/or references of $repo to latest snapshots" \
-m "$repo updated to its latest own and reference snapshots"