From d7d9a664cb6d45b1019f8ac897feac512e5b37e8 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 1 Mar 2022 21:01:03 +0000 Subject: 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 --- integration/src/release_scripts/updateParentRef.sh | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'integration/src/release_scripts/updateParentRef.sh') diff --git a/integration/src/release_scripts/updateParentRef.sh b/integration/src/release_scripts/updateParentRef.sh index 0f10cfbb..0f72aa53 100755 --- a/integration/src/release_scripts/updateParentRef.sh +++ b/integration/src/release_scripts/updateParentRef.sh @@ -22,7 +22,7 @@ set -e -SCRIPT_NAME=`basename $0` +SCRIPT_NAME=$(basename "$0") # Use the bash internal OSTYPE variable to check for MacOS if [[ "$OSTYPE" == "darwin"* ]] @@ -107,22 +107,24 @@ then exit 1 fi -pom_lines=`wc -l $pom_file | $SED 's/^[ \t]*//' | cut -f1 -d' '` -parent_start_line=`grep -n '^[\t ]*[\t ]*$' $pom_file | cut -f1 -d':'` -parent_end_line=`grep -n '^[\t ]*[\t ]*$' $pom_file | cut -f1 -d':'` +pom_lines=$(wc -l "$pom_file" | $SED 's/^[ \t]*//' | cut -f1 -d' ') +parent_start_line=$(grep -n '^[\t ]*[\t ]*$' "$pom_file" | cut -f1 -d':') +parent_end_line=$(grep -n '^[\t ]*[\t ]*$' "$pom_file" | cut -f1 -d':') pom_head_lines=$((parent_start_line-1)) pom_tail_lines=$((pom_lines-parent_end_line)) pom_temp_file=$(mktemp) -head -$pom_head_lines $pom_file > $pom_temp_file -echo " " >> $pom_temp_file -echo " $group_id" >> $pom_temp_file -echo " $artifact_id" >> $pom_temp_file -echo " $version" >> $pom_temp_file -echo " " >> $pom_temp_file -echo " " >> $pom_temp_file -tail -$pom_tail_lines $pom_file >> $pom_temp_file - -mv $pom_temp_file $pom_file +{ + head -$pom_head_lines "$pom_file" + echo " " + echo " $group_id" + echo " $artifact_id" + echo " $version" + echo " " + echo " " + tail -$pom_tail_lines "$pom_file" +} > "$pom_temp_file" + +mv "$pom_temp_file" "$pom_file" -- cgit 1.2.3-korg