Unverified Commit 47b9f214 authored by huayuenh's avatar huayuenh Committed by GitHub
Browse files

deploy using image digest (#134)

* use digest for deploy

* test digest deploy

* test digest

* test digest

* test digest

* test digest

* test digest

* test pr

* test digest deploy classic

* Add digest deploy to classic

* restore script path
parent e1620238
......@@ -144,6 +144,13 @@ stages:
# Minting image tag using format: BUILD_NUMBER-BRANCH-COMMIT_ID-TIMESTAMP
# 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")
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
- name: Check vulnerabilities
type: tester
test_type: vulnerabilityadvisor
......
......@@ -299,9 +299,9 @@ spec:
# For doi plugin invocation if needed
export TOOLCHAIN_ID=$PIPELINE_TOOLCHAIN_ID
# Single tag for the image built
export IMAGE_TAG=$IMAGE_TAGS
export IMAGE_MANIFEST_SHA="$(tasks.containerize.results.image-digest)"
# Keep it in build.properties shuttle file
echo "IMAGE_TAG=$IMAGE_TAGS" >> build.properties
echo "IMAGE_MANIFEST_SHA=$IMAGE_MANIFEST_SHA" >> build.properties
- name: script
value: |
# uncomment to debug the script
......
......@@ -400,10 +400,9 @@ 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_TAG=$IMAGE_TAGS
export IMAGE_MANIFEST_SHA="$(tasks.containerize.results.image-digest)"
# Keep it in build.properties shuttle file
echo "IMAGE_TAG=$IMAGE_TAGS" >> build.properties
echo "IMAGE_MANIFEST_SHA=$IMAGE_MANIFEST_SHA" >> build.properties
- name: script
value: |
# uncomment to debug the script
......
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