From 53bb408e693c2613b6a24a4ce3c1cb231507f787 Mon Sep 17 00:00:00 2001 From: Yuxiang Zhu Date: Nov 13 2018 09:39:02 +0000 Subject: CI/CD: use commit ID to track a commit in post-merge workflow Due to #244, we switched to branch name to tracking a commit during a pipeline build. This leads to a risk for a post-merge build: Because multiple checkouts are done during a pipeline build, it is possible to get different commits if master branch advances. So we should still use commit ID to track a commit in the post-merge workflow. --- diff --git a/openshift/pipelines/templates/waiverdb-polling-pagure.yaml b/openshift/pipelines/templates/waiverdb-polling-pagure.yaml index 2c005aa..9c06fbf 100644 --- a/openshift/pipelines/templates/waiverdb-polling-pagure.yaml +++ b/openshift/pipelines/templates/waiverdb-polling-pagure.yaml @@ -228,7 +228,7 @@ objects: def isMaster = env.PAGURE_POLLING_FOR_PR != 'true' def devBuild = bcSelector.startBuild( '-e', "WAIVERDB_GIT_REPO=${env.GIT_URL}", - '-e', "WAIVERDB_GIT_REF=${env.GIT_BRANCH}", + '-e', "WAIVERDB_GIT_REF=${isMaster? env.GIT_COMMIT : env.GIT_BRANCH}", '-e', "FORCE_PUBLISH_IMAGE=${isMaster}", '-e', "FORCE_PUBLISH_DOCS=${isMaster}", '-e', "WAIVERDB_MAIN_BRANCH=${PAGURE_POLLED_BRANCH}", @@ -242,7 +242,7 @@ objects: if (env.PAGURE_POLLING_FOR_PR == 'true') { // setting PR status to Pending setBuildStatusOnPagurePR(null, 'Pending') - } + } echo "Waiting for dev build ${devBuildInfo.metadata.name}(${env.DEV_BUILD_URL}) to complete..." devBuild.watch { return it.object().status.phase != "Running"