summaryrefslogtreecommitdiffstats
path: root/integration/src/release_scripts/getReleaseData.sh
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2022-01-12 13:24:54 +0000
committerliamfallon <liam.fallon@est.tech>2022-01-17 12:17:19 +0000
commitb76315a09b466166a6eec6f0b22f58d3e432c7b9 (patch)
tree7ee40804ba9dc245237b2047064516bf9c849d9e /integration/src/release_scripts/getReleaseData.sh
parent0c3008fd6b925edc26c282901fafac17d516abff (diff)
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 <liam.fallon@est.tech>
Diffstat (limited to 'integration/src/release_scripts/getReleaseData.sh')
-rwxr-xr-xintegration/src/release_scripts/getReleaseData.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/integration/src/release_scripts/getReleaseData.sh b/integration/src/release_scripts/getReleaseData.sh
index dce8fa2c..3d3bad9d 100755
--- a/integration/src/release_scripts/getReleaseData.sh
+++ b/integration/src/release_scripts/getReleaseData.sh
@@ -26,6 +26,14 @@ SCRIPT_NAME=`basename $0`
repo_location="./"
release_data_file="./pf_release_data.csv"
+# Use the bash internal OSTYPE variable to check for MacOS
+if [[ "$OSTYPE" == "darwin"* ]]
+then
+ SED="gsed"
+else
+ SED="sed"
+fi
+
declare -a pf_repos=(
"policy/parent"
"policy/docker"
@@ -138,7 +146,7 @@ get_tags() {
latest_snapshot_tag=`mvn -f $repo_location/$repo clean | \
grep "SNAPSHOT" | \
tail -1 | \
- sed -r 's/^.* ([0-9]*\.[0-9]*\.[0-9]*-SNAPSHOT).*$/\1/'`
+ $SED -r 's/^.* ([0-9]*\.[0-9]*\.[0-9]*-SNAPSHOT).*$/\1/'`
changed_files=`git -C $repo_location/$repo diff --name-only $latest_released_tag origin/master | \
grep -v 'pom.xml$' | \
@@ -146,14 +154,14 @@ get_tags() {
grep -v "^releases/$latest_released_tag.yaml$" | \
grep -v "^releases/$latest_released_tag-container.yaml$" | \
wc -l | \
- sed 's/^[[:space:]]*//g'`
+ $SED 's/^[[:space:]]*//g'`
if [ -f $repo_location/$repo/releases/$latest_released_tag-container.yaml ]
then
docker_images=`grep '\- name:' $repo_location/$repo/releases/$latest_released_tag-container.yaml | \
- sed -e 's/\- //g' -e 's/\://g' -e "s/\'//g" -e 's/^[[:space:]]*//g' -e 's/^name //' | \
+ $SED -e 's/\- //g' -e 's/\://g' -e "s/\'//g" -e 's/^[[:space:]]*//g' -e 's/^name //' | \
tr '\n' ':' | \
- sed 's/:$//'`
+ $SED 's/:$//'`
else
docker_images=""
fi