From 8010aabe384d1f2209dd8ec4c884ec7e8bd40988 Mon Sep 17 00:00:00 2001 From: Simon Kordas <45798030+skordas@users.noreply.github.com> Date: Wed, 14 Sep 2022 13:02:44 -0400 Subject: [PATCH] Moving cleaning before scaling down the cluster. (#262) --- Jenkinsfile | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7f2ef5af..f0177c58 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -304,17 +304,7 @@ pipeline { } script { - // if the build fails, scale down will not happen, letting user review and decide if cluster is ready for scale down or re-run the job on same cluster - if (params.SCALE_DOWN.toInteger() > 0) { - build job: 'scale-ci/e2e-benchmarking-multibranch-pipeline/cluster-workers-scaling', - parameters: [ - string(name: 'BUILD_NUMBER', value: BUILD_NUMBER), string(name: 'WORKER_COUNT', value: SCALE_DOWN), - text(name: "ENV_VARS", value: ENV_VARS), string(name: 'JENKINS_AGENT_LABEL', value: JENKINS_AGENT_LABEL) - ] - } - } - - script { + // if the build fails, cleaning and scale down will not happen, letting user review and decide if cluster is ready for scale down or re-run the job on same cluster if (params.CLEANUP == true) { build job: 'scale-ci/e2e-benchmarking-multibranch-pipeline/benchmark-cleaner', parameters: [ @@ -325,6 +315,17 @@ pipeline { propagate: false } } + + script { + if (params.SCALE_DOWN.toInteger() > 0) { + build job: 'scale-ci/e2e-benchmarking-multibranch-pipeline/cluster-workers-scaling', + parameters: [ + string(name: 'BUILD_NUMBER', value: BUILD_NUMBER), string(name: 'WORKER_COUNT', value: SCALE_DOWN), + text(name: "ENV_VARS", value: ENV_VARS), string(name: 'JENKINS_AGENT_LABEL', value: JENKINS_AGENT_LABEL) + ] + } + } + } } }