From b76315a09b466166a6eec6f0b22f58d3e432c7b9 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Wed, 12 Jan 2022 13:24:54 +0000 Subject: Add release script, fix sed for MacOS This commit: - Adds a releease phase script that somewhat automates releases - updates the scritps to use GNU sed on MacOS Issue-ID: POLICY-3835 Change-Id: I2b79c6a3cc3476280ac00a2288e3cb8686ee976a Signed-off-by: liamfallon --- integration/src/release_scripts/updateParentRef.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 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 1978e33d..0f10cfbb 100755 --- a/integration/src/release_scripts/updateParentRef.sh +++ b/integration/src/release_scripts/updateParentRef.sh @@ -24,6 +24,14 @@ set -e SCRIPT_NAME=`basename $0` +# Use the bash internal OSTYPE variable to check for MacOS +if [[ "$OSTYPE" == "darwin"* ]] +then + SED="gsed" +else + SED="sed" +fi + usage() { echo "" @@ -99,9 +107,9 @@ 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)) -- cgit 1.2.3-korg