From 889542599f2016f373b47e32c90f4b9c93a56570 Mon Sep 17 00:00:00 2001 From: Yuxiang Zhu Date: Feb 21 2019 03:34:34 +0000 Subject: CI/CD: Correct `scratch` values in ci.container-image.test.complete messages Following up https://pagure.io/waiverdb/pull-request/281. `scratch` field should be set to `true` for a PR test while `false` for other tests. New job parameter `IMAGE_IS_SCRATCH` is introduced to indicate if the tested container image is "scratch". --- diff --git a/openshift/pipelines/templates/waiverdb-dev.Jenkinsfile b/openshift/pipelines/templates/waiverdb-dev.Jenkinsfile index 95a779b..4314d0b 100644 --- a/openshift/pipelines/templates/waiverdb-dev.Jenkinsfile +++ b/openshift/pipelines/templates/waiverdb-dev.Jenkinsfile @@ -291,6 +291,7 @@ pipeline { '-e', "IMAGE=${env.RESULTING_IMAGE_REPO}:${env.RESULTING_TAG}", '-e', "WAIVERDB_GIT_REPO=${params.WAIVERDB_GIT_REPO}", '-e', "WAIVERDB_GIT_REF=${params.WAIVERDB_GIT_REF}", + '-e', "IMAGE_IS_SCRATCH=${params.WAIVERDB_GIT_REF != params.WAIVERDB_MAIN_BRANCH}", ) echo 'Waiting for the integration test result...' timeout(time: 20) { // 20 min diff --git a/openshift/pipelines/templates/waiverdb-integration-test-template.yaml b/openshift/pipelines/templates/waiverdb-integration-test-template.yaml index 5e8486a..16cf7d2 100644 --- a/openshift/pipelines/templates/waiverdb-integration-test-template.yaml +++ b/openshift/pipelines/templates/waiverdb-integration-test-template.yaml @@ -80,6 +80,8 @@ objects: value: "${WAIVERDB_GIT_REF}" - name: "IMAGE" value: "${IMAGE}" + - name: IMAGE_IS_SCRATCH + value: "false" - name: "CONTAINER_REGISTRY_CREDENTIALS" value: "${CONTAINER_REGISTRY_CREDENTIALS}" - name: "TEST_ID" diff --git a/openshift/pipelines/templates/waiverdb-integration-test.Jenkinsfile b/openshift/pipelines/templates/waiverdb-integration-test.Jenkinsfile index 91cdb22..5ca4e96 100644 --- a/openshift/pipelines/templates/waiverdb-integration-test.Jenkinsfile +++ b/openshift/pipelines/templates/waiverdb-integration-test.Jenkinsfile @@ -191,7 +191,7 @@ pipeline { "digest": "${env.IMAGE_DIGEST}", "nvr": "waiverdb:${env.IMAGE_TAG}", "issuer": "c3i-jenkins", - "scratch": true + "scratch": ${params.IMAGE_IS_SCRATCH} }, "system": [{