aboutsummaryrefslogtreecommitdiffstats
path: root/integration/src/release_scripts/mkart.sh
diff options
context:
space:
mode:
authorJorge Hernandez <jorge.hernandez-herrero@att.com>2022-01-19 15:31:03 +0000
committerGerrit Code Review <gerrit@onap.org>2022-01-19 15:31:03 +0000
commit956c8d8c3ba66a4b2d585c59759fdbaf9199a77e (patch)
treef14dca0b3999fcdbdcb26837fa71dfecf535cc9b /integration/src/release_scripts/mkart.sh
parent004586ddd68eb414ee5fed9fa24ba56d7226fb21 (diff)
parentb76315a09b466166a6eec6f0b22f58d3e432c7b9 (diff)
Merge "Add release script, fix sed for MacOS"
Diffstat (limited to 'integration/src/release_scripts/mkart.sh')
-rwxr-xr-xintegration/src/release_scripts/mkart.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/integration/src/release_scripts/mkart.sh b/integration/src/release_scripts/mkart.sh
index 48a368ec..62ec0302 100755
--- a/integration/src/release_scripts/mkart.sh
+++ b/integration/src/release_scripts/mkart.sh
@@ -36,6 +36,14 @@
# can get through the firewall.
#
+# Use the bash internal OSTYPE variable to check for MacOS
+if [[ "$OSTYPE" == "darwin"* ]]
+then
+ SED="gsed"
+else
+ SED="sed"
+fi
+
set -e
has_docker_images=false
@@ -60,20 +68,20 @@ fi
echo Branch: ${BRANCH}
PROJECT=$(awk -F= '$1 == "project" { print $2 }' "${TOPDIR}/.gitreview" |
- sed 's/.git$//')
+ $SED 's/.git$//')
if [ -z "${PROJECT}" ]; then
echo "cannot extract project from ${TOPDIR}/.gitreview" >&2
exit 1
fi
echo Project: ${PROJECT}
-TPROJ=$(echo ${PROJECT} | sed 's!/!%2F!')
-DPROJ=$(echo ${PROJECT} | sed 's!/!-!')
+TPROJ=$(echo ${PROJECT} | $SED 's!/!%2F!')
+DPROJ=$(echo ${PROJECT} | $SED 's!/!-!')
VERSION=$(
xmllint --xpath \
'/*[local-name()="project"]/*[local-name()="version"]/text()' \
"${TOPDIR}/pom.xml" |
- sed 's!-SNAPSHOT!!'
+ $SED 's!-SNAPSHOT!!'
)
if [ -z "${VERSION}" ]; then
echo "cannot extract version from ${TOPDIR}/pom.xml" >&2
@@ -85,7 +93,7 @@ prefix='https://jenkins.onap.org/view/policy/job/'
STAGE_ID=$(
curl --silent ${prefix}${DPROJ}-maven-stage-${BRANCH}/ |
grep "Last completed build" |
- sed -e 's!.*Last completed build .#!!' -e 's!).*!!' |
+ $SED -e 's!.*Last completed build .#!!' -e 's!).*!!' |
head -1
)
if [ -z "${STAGE_ID}" ]; then