summaryrefslogtreecommitdiffstats
path: root/integration/src/release_scripts/mkdock.sh
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2022-03-01 21:01:03 +0000
committerliamfallon <liam.fallon@est.tech>2022-03-01 21:05:54 +0000
commitd7d9a664cb6d45b1019f8ac897feac512e5b37e8 (patch)
treeaeda2f2c5b71e61abb81a086e69530b021be6f62 /integration/src/release_scripts/mkdock.sh
parent006a229e166b5656fd9ba320e2b36d33c7e945a8 (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/mkdock.sh')
-rwxr-xr-xintegration/src/release_scripts/mkdock.sh23
1 files changed, 12 insertions, 11 deletions
diff --git a/integration/src/release_scripts/mkdock.sh b/integration/src/release_scripts/mkdock.sh
index 4f1b3e2c..0df4abad 100755
--- a/integration/src/release_scripts/mkdock.sh
+++ b/integration/src/release_scripts/mkdock.sh
@@ -47,6 +47,7 @@ else
SED="sed"
fi
+# shellcheck disable=SC2166
if [ $# -lt 1 -o "$1" = "-?" ]
then
echo "arg(s): docker-container-name1 docker-container-name2 ..." >&2
@@ -64,7 +65,7 @@ if [ -z "${BRANCH}" ]; then
echo "cannot extract default branch from ${TOPDIR}/.gitreview" >&2
exit 1
fi
-echo Branch: ${BRANCH}
+echo "Branch: ${BRANCH}"
PROJECT=$(awk -F= '$1 == "project" { print $2 }' "${TOPDIR}/.gitreview" |
$SED 's/.git$//')
@@ -72,9 +73,8 @@ 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!/!-!')
+echo "Project: ${PROJECT}"
+DPROJ=$(echo "${PROJECT}" | $SED 's!/!-!')
RELEASE=$(
xmllint --xpath \
@@ -86,18 +86,18 @@ if [ -z "${RELEASE}" ]; then
echo "cannot extract release from ${TOPDIR}/pom.xml" >&2
exit 1
fi
-echo Release: ${RELEASE}
+echo "Release: ${RELEASE}"
REF_ID=$(git log | grep commit | head -1 | awk '{ print $2 }')
if [ -z "${REF_ID}" ]; then
echo "cannot extract ref from 'git log'" >&2
exit 1
fi
-echo Ref: ${REF_ID}
+echo "Ref: ${REF_ID}"
prefix='https://jenkins.onap.org/view/policy/job/'
STAGE_ID=$(
- curl --silent ${prefix}${DPROJ}-maven-docker-stage-${BRANCH}/ |
+ curl --silent "${prefix}${DPROJ}-maven-docker-stage-${BRANCH}/" |
grep "Last completed build" |
$SED -e 's!.*Last completed build .#!!' -e 's!).*!!' |
head -1
@@ -107,17 +107,18 @@ if [ -z "${STAGE_ID}" ]; then
exit 1
fi
STAGE_ID=${DPROJ}-maven-docker-stage-${BRANCH}/${STAGE_ID}
-echo Stage ID: ${STAGE_ID}
+echo "Stage ID: ${STAGE_ID}"
prefix='https://jenkins.onap.org/view/policy/job/'
-JOB_OUT=$(curl --silent ${prefix}${STAGE_ID}/console)
+JOB_OUT=$(curl --silent "${prefix}${STAGE_ID}/consoleFull")
echo "${JOB_OUT}" | grep -q "Finished: SUCCESS"
+# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
echo "last docker build has not completed successfully" >&2
exit 1
fi
-echo Creating ${TOPDIR}/releases/${RELEASE}-container.yaml
+echo "Creating ${TOPDIR}/releases/${RELEASE}-container.yaml"
cat >"${TOPDIR}/releases/${RELEASE}-container.yaml" <<EOT
distribution_type: 'container'
container_release_tag: '${RELEASE}'
@@ -144,7 +145,7 @@ do
echo "cannot extract ${CONT_NAME} version from jenkins build output" >&2
exit 1
fi
- echo ${CONT_NAME} version: ${VERSION}
+ echo "${CONT_NAME} version: ${VERSION}"
cat >>"${TOPDIR}/releases/${RELEASE}-container.yaml" <<EOT_LOOP
- name: '${CONT_NAME}'