Unverified Commit 62e72ac0 authored by huayuenh's avatar huayuenh Committed by GitHub
Browse files

Digest deploy update (#152)

* set the full image name and export to build.properties
parent 47b9f214
......@@ -145,12 +145,15 @@ stages:
# Also copies information into a build.properties file, so they can be reused later on by other scripts (e.g. image url, chart name, ...)
source <(curl -sSL "https://raw.githubusercontent.com/open-toolchain/commons/master/scripts/build_image_buildkit.sh")
# extract the image digest
ibmcloud cr image-digests --json --restrict ${REGISTRY_NAMESPACE}/${IMAGE_NAME} | jq -c '.[]' > list
TARGET_IMAGE=$(grep -F "${IMAGE_TAG}" list)
echo "TARGET_IMAGE $TARGET_IMAGE"
DIGEST=$(echo $TARGET_IMAGE | jq -r '.id')
echo "DIGEST $DIGEST"
echo "IMAGE_MANIFEST_SHA=${DIGEST}" >> $ARCHIVE_DIR/build.properties
IMAGE="${REGISTRY_URL}/${REGISTRY_NAMESPACE}/${IMAGE_NAME}@${DIGEST}"
echo "IMAGE=${IMAGE}" >> $ARCHIVE_DIR/build.properties
- name: Check vulnerabilities
type: tester
test_type: vulnerabilityadvisor
......
......@@ -298,10 +298,6 @@ spec:
echo "SOURCE_BUILD_NUMBER=$BUILD_NUMBER" >> build.properties
# For doi plugin invocation if needed
export TOOLCHAIN_ID=$PIPELINE_TOOLCHAIN_ID
# Single tag for the image built
export IMAGE_MANIFEST_SHA="$(tasks.containerize.results.image-digest)"
# Keep it in build.properties shuttle file
echo "IMAGE_MANIFEST_SHA=$IMAGE_MANIFEST_SHA" >> build.properties
- name: script
value: |
# uncomment to debug the script
......@@ -320,6 +316,8 @@ spec:
value: |
# Keep APP_URL in build.properties shuttle file
echo "APP_URL=$APP_URL" >> build.properties
IMAGE="${REGISTRY_URL}/${REGISTRY_NAMESPACE}/${IMAGE_NAME}@${IMAGE_MANIFEST_SHA}"
echo "IMAGE=${IMAGE}" >> build.properties
- name: pipeline-debug
value: $(params.pipeline-debug)
workspaces:
......
......@@ -400,9 +400,6 @@ spec:
echo "SOURCE_BUILD_NUMBER=$BUILD_NUMBER" >> build.properties
# For doi plugin invocation if needed
export TOOLCHAIN_ID=$PIPELINE_TOOLCHAIN_ID
export IMAGE_MANIFEST_SHA="$(tasks.containerize.results.image-digest)"
# Keep it in build.properties shuttle file
echo "IMAGE_MANIFEST_SHA=$IMAGE_MANIFEST_SHA" >> build.properties
- name: script
value: |
# uncomment to debug the script
......@@ -421,6 +418,8 @@ spec:
value: |
# Keep APP_URL in build.properties shuttle file
echo "APP_URL=$APP_URL" >> build.properties
IMAGE="${REGISTRY_URL}/${REGISTRY_NAMESPACE}/${IMAGE_NAME}@${IMAGE_MANIFEST_SHA}"
echo "IMAGE=${IMAGE}" >> build.properties
- name: pipeline-debug
value: $(params.pipeline-debug)
workspaces:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment