X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=jenkins%2Fci-pipelines%2Fci_stage_2.groovy;h=d0e9d9dc3ccab65f567b483c8b5f47af52d932b0;hb=0550e3ddfe0b00213d97e445936c56e8ca5cda67;hp=7fca49d124d72c10ea7d519b6677c75451cd3455;hpb=d92834a7aa90e10ef67867d1e095ff0e01e871b4;p=osm%2Fdevops.git diff --git a/jenkins/ci-pipelines/ci_stage_2.groovy b/jenkins/ci-pipelines/ci_stage_2.groovy index 7fca49d1..d0e9d9dc 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) { - 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,31 +52,37 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,build_system) { sh "docker build -t ${container_name} ." } - withDockerContainer("${container_name}") { + withDockerContainer(image: "${container_name}", args: docker_args) { stage('Test') { sh 'devops-stages/stage-test.sh' } stage('Build') { sh(returnStdout:true, script: 'devops-stages/stage-build.sh').trim() } + stage('Archive') { + sh "mkdir -p changelog" + sh "devops/tools/generatechangelog-pipeline.sh > changelog/changelog-${mdg}.html" + sh(returnStdout:true, script: 'devops-stages/stage-archive.sh').trim() + ci_helper.archive(artifactory_server,mdg,branch,'untested') + } } - stage('Archive') { - sh(returnStdout:true, script: 'devops-stages/stage-archive.sh').trim() - ci_helper.archive(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()