From 2cc51444ccd64f53d6deb5b3721f4cb01f170da0 Mon Sep 17 00:00:00 2001 From: Mike Marchetti Date: Fri, 23 Jun 2017 10:24:22 -0400 Subject: [PATCH] update to jenkins Signed-off-by: Mike Marchetti --- Jenkinsfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 86e0514..d0bc7ac 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,12 @@ +properties([ + parameters([ + string(defaultValue: env.GERRIT_BRANCH, description: '', name: 'GERRIT_BRANCH'), + string(defaultValue: env.GERRIT_PROJEC, description: '', name: 'GERRIT_PROJECT'), + string(defaultValue: env.GERRIT_REFSPEC, description: '', name: 'GERRIT_REFSPEC'), + string(defaultValue: env.GERRIT_PATCHSET_REVISION, description: '', name: 'GERRIT_PATCHSET_REVISION'), + ]) +]) + def Get_MDG(project) { // split the project. def values = project.split('/') @@ -28,7 +37,9 @@ node { mdg = Get_MDG("${GERRIT_PROJECT}") println("MDG is ${mdg}") - if ( GERRIT_EVENT_TYPE.equals('change-merged') ) { + if ( env.GERRIT_EVENT_TYPE != null ) { + // pipeline running from gerrit trigger. + // kickoff the downstream multibranch pipeline def downstream_params = [ string(name: 'GERRIT_BRANCH', value: GERRIT_BRANCH), string(name: 'GERRIT_PROJECT', value: GERRIT_PROJECT), @@ -54,7 +65,6 @@ node { container_name = "${GERRIT_PROJECT}-${GERRIT_BRANCH}" - stage('Docker-Build') { sh "docker build -t ${container_name} ." } -- 2.17.1