From: Mark Beierl Date: Sat, 28 Jan 2023 04:05:48 +0000 (+0000) Subject: Improve Merge Job Speed X-Git-Tag: release-v14.0-start~117 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F96%2F12896%2F1;p=osm%2Fdevops.git Improve Merge Job Speed Checks for charms that were changed for the merge job too instead of forcing all charms to be rebuilt Change-Id: I9018813ba087cd968968dc98f6167097a8ca4bdb Signed-off-by: Mark Beierl --- diff --git a/jenkins/ci-pipelines/ci_stage_2.groovy b/jenkins/ci-pipelines/ci_stage_2.groovy index a6dcfa46..0691dcc8 100644 --- a/jenkins/ci-pipelines/ci_stage_2.groovy +++ b/jenkins/ci-pipelines/ci_stage_2.groovy @@ -147,9 +147,14 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,do_stage_3,artifa for (charmPath in charms) { def directory = charmPath if (fileExists("$charmPath/charmcraft.yaml")) { - CHECK_CHANGES = "git diff --name-only origin/$GERRIT_BRANCH -- $directory |wc -l" + if (isMergeJob) { + CHECK_CHANGES = "git diff --name-only HEAD^1 -- $directory |wc -l" + } else { + CHECK_CHANGES = "git diff --name-only origin/$GERRIT_BRANCH -- $directory |wc -l" + } charmsChanged = sh(returnStdout:true, script: CHECK_CHANGES).trim() - if (charmsChanged != "0" || isMergeJob) { + + if (charmsChanged != "0") { println("$directory has changes, rebuilding") parallelSteps[directory] = {