diff options
author | 2022-03-01 21:01:03 +0000 | |
---|---|---|
committer | 2022-03-01 21:05:54 +0000 | |
commit | d7d9a664cb6d45b1019f8ac897feac512e5b37e8 (patch) | |
tree | aeda2f2c5b71e61abb81a086e69530b021be6f62 /integration/src/release_scripts/releaseRepoImages.sh | |
parent | 006a229e166b5656fd9ba320e2b36d33c7e945a8 (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/releaseRepoImages.sh')
-rwxr-xr-x | integration/src/release_scripts/releaseRepoImages.sh | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/integration/src/release_scripts/releaseRepoImages.sh b/integration/src/release_scripts/releaseRepoImages.sh index d7c5bea3..0bcae6a4 100755 --- a/integration/src/release_scripts/releaseRepoImages.sh +++ b/integration/src/release_scripts/releaseRepoImages.sh @@ -20,9 +20,7 @@ # ============LICENSE_END================================================== # -set -e - -SCRIPT_NAME=`basename $0` +SCRIPT_NAME=$(basename "$0") repo_location="./" release_data_file="./pf_release_data.csv" @@ -121,12 +119,13 @@ then exit 1 fi -read repo \ +# shellcheck disable=SC2034 +read -r repo \ latest_released_tag \ latest_snapshot_tag \ changed_files \ docker_images \ - <<< $( grep $specified_repo $release_data_file | tr ',' ' ' ) + <<< "$(grep "$specified_repo" "$release_data_file" | tr ',' ' ' )" if [ ! "$repo" = "$specified_repo" ] then @@ -138,7 +137,7 @@ next_release_version=${latest_snapshot_tag%-*} while true do - read -p "have you run 'stage_release' on the '$repo' repo? " yes_no + read -r -p "have you run 'stage_release' on the '$repo' repo? " yes_no case $yes_no in [Yy]* ) break ;; @@ -153,10 +152,16 @@ done if [ "$docker_images" != "" ] then - saved_current_dir=`pwd` - cd $repo_location/$repo - mkdock.sh `echo "$docker_images" | tr ':' " "` - cd $saved_current_dir + saved_current_dir=$(pwd) + cd "$repo_location/$repo" || exit 1 + # shellcheck disable=SC2046 + if ! mkdock.sh $(echo "$docker_images" | sed -e "s/'//g" -e "s/:/ /g") + then + echo "generation of docker image release container yaml file failed" + cd "$saved_current_dir" || exit 1 + exit 1 + fi + cd "$saved_current_dir" || exit 1 else echo "repo '$repo' does not have any docker images" exit 1 @@ -165,9 +170,9 @@ fi echo "generating commit for $repo docker image release: $latest_released_tag-->$next_release_version . . ." generateCommit.sh \ - -l $repo_location \ - -r $repo \ - -i $issue_id \ + -l "$repo_location" \ + -r "$repo" \ + -i "$issue_id" \ -e "Release docker images for $repo: $next_release_version" \ -m "This commit releases docker images for repo $repo." |