X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=jenkins%2Fci-pipelines%2Fci_stage_2.groovy;h=76201111402b84211127573e5552152446b9923c;hb=f94dd8ac7841b04e51bb50924b9ef369a6752b5e;hp=5a5643d486f0a6135ad5b0f672b17bd5bdfd2ee3;hpb=c121ff81ff1018d0f59af6d04503f3e8087e7c74;p=osm%2Fdevops.git diff --git a/jenkins/ci-pipelines/ci_stage_2.groovy b/jenkins/ci-pipelines/ci_stage_2.groovy index 5a5643d4..76201111 100644 --- a/jenkins/ci-pipelines/ci_stage_2.groovy +++ b/jenkins/ci-pipelines/ci_stage_2.groovy @@ -26,8 +26,8 @@ def project_checkout(url_prefix,project,refspec,revision) { } } -def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,build_system,artifactory_server) { - println("build_system = ${build_system}") +def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,do_stage_3,artifactory_server,docker_args="",do_stage_4=false) { + println("do_stage_3= ${do_stage_3}") ci_helper = load "devops/jenkins/ci-pipelines/ci_helper.groovy" stage('Prepare') { @@ -52,7 +52,7 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,build_system,arti sh "docker build -t ${container_name} ." } - withDockerContainer("${container_name}") { + withDockerContainer(image: "${container_name}", args: docker_args) { stage('Test') { sh 'devops-stages/stage-test.sh' } @@ -66,17 +66,22 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,build_system,arti ci_helper.archive(artifactory_server,mdg,branch,'untested') } - if ( build_system ) { + if ( do_stage_3 ) { stage('Build System') { def downstream_params_stage_3 = [ string(name: 'GERRIT_BRANCH', value: "${branch}"), string(name: 'UPSTREAM_JOB_NAME', value: "${JOB_NAME}" ), string(name: 'UPSTREAM_JOB_NUMBER', value: "${BUILD_NUMBER}" ), + booleanParam(name: 'DO_STAGE_4', value: do_stage_4 ) ] + stage_3_job = "osm-stage_3" + if ( JOB_NAME.contains('merge') ) { + stage_3_job += '-merge' + } - // callout to stage_3. This is the system build - result = build job: "osm-stage_3/${branch}", parameters: downstream_params_stage_3, propagate: true + // callout to stage_3. This is the system build + result = build job: "${stage_3_job}/${branch}", parameters: downstream_params_stage_3, propagate: true if (result.getResult() != 'SUCCESS') { project = result.getProjectName() build = result.getNumber()