From: Mike Marchetti Date: Wed, 22 Nov 2017 21:34:20 +0000 (-0500) Subject: catch if not using gerrit triggers X-Git-Tag: v3.0.2~7 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F21%2F5721%2F1;p=osm%2Fdevops.git catch if not using gerrit triggers Signed-off-by: Mike Marchetti --- diff --git a/jenkins/ci-pipelines/ci_stage_1.groovy b/jenkins/ci-pipelines/ci_stage_1.groovy index 251d36e7..d74de591 100644 --- a/jenkins/ci-pipelines/ci_stage_1.groovy +++ b/jenkins/ci-pipelines/ci_stage_1.groovy @@ -36,18 +36,24 @@ node("${params.NODE}") { } stage('downstream') { - // initially use stage_name as the event_type - def stage_name = GERRIT_EVENT_TYPE + // default to stage_2 (patchset) + def stage_name = "stage_2" - switch(GERRIT_EVENT_TYPE) { - case "change-merged": - stage_name = "stage_2-merge" - break + try { + switch(GERRIT_EVENT_TYPE) { + case "change-merged": + stage_name = "stage_2-merge" + break - case "patchset-created": - stage_name = "stage_2" - break + case "patchset-created": + stage_name = "stage_2" + break + } + } + catch(caughtError) { + println("No gerrit event found") } + do_stage_4 = false if (params.DO_STAGE_4) {