From: Mike Marchetti Date: Fri, 23 Jun 2017 14:24:22 +0000 (-0400) Subject: update to jenkins X-Git-Tag: v8.0-start~14 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=2cc51444ccd64f53d6deb5b3721f4cb01f170da0;p=test.git update to jenkins Signed-off-by: Mike Marchetti --- 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} ." }