X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=jenkins%2Fci-pipelines%2Fci_stage_2.groovy;h=d51c298d1ecee0f4bdc27a504868e22bdf999f2a;hb=8244229fc73c250129b279b1d0e90f3d7effdf66;hp=45cbc7d664059f665072a70492709c7c89cdb8c0;hpb=771f06aae780e07eb9b2929374989b641aae851c;p=osm%2Fdevops.git diff --git a/jenkins/ci-pipelines/ci_stage_2.groovy b/jenkins/ci-pipelines/ci_stage_2.groovy index 45cbc7d6..d51c298d 100644 --- a/jenkins/ci-pipelines/ci_stage_2.groovy +++ b/jenkins/ci-pipelines/ci_stage_2.groovy @@ -26,7 +26,7 @@ def project_checkout(url_prefix,project,refspec,revision) { } } -def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,build_system) { +def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,build_system,artifactory_server,docker_args="") { println("build_system = ${build_system}") ci_helper = load "devops/jenkins/ci-pipelines/ci_helper.groovy" @@ -45,16 +45,14 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,build_system) { container_name = "${project}-${branch}".toLowerCase() stage('Docker-Build') { + sh ''' + echo RUN groupadd -o -g $(id -g) -r jenkins >> Dockerfile + echo RUN useradd -o -u $(id -u) --create-home -r -g jenkins jenkins >> Dockerfile + ''' sh "docker build -t ${container_name} ." } - withDockerContainer("${container_name}") { - stage('Docker-Setup') { - sh ''' - groupadd -o -g $(id -g) -r jenkins - useradd -o -u $(id -u) --create-home -r -g jenkins jenkins - ''' - } + withDockerContainer(image: "${container_name}", args: docker_args) { stage('Test') { sh 'devops-stages/stage-test.sh' } @@ -65,7 +63,7 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,build_system) { stage('Archive') { sh(returnStdout:true, script: 'devops-stages/stage-archive.sh').trim() - ci_helper.archive(mdg,branch,'untested') + ci_helper.archive(artifactory_server,mdg,branch,'untested') } if ( build_system ) { @@ -76,9 +74,13 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,build_system) { string(name: 'UPSTREAM_JOB_NAME', value: "${JOB_NAME}" ), string(name: 'UPSTREAM_JOB_NUMBER', value: "${BUILD_NUMBER}" ), ] + 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()