X-Git-Url: https://osm.etsi.org/gitweb/?p=test.git;a=blobdiff_plain;f=Jenkinsfile;h=d0bc7ac807092221cce926db24d995abb02aadeb;hp=86e051416152543d882fc4ed9fbda3596e8f9d61;hb=2cc51444ccd64f53d6deb5b3721f4cb01f170da0;hpb=66e1c2bc13002c40974623f0fb8dc6ef0f2cdb17 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} ." }