X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=jenkins%2Fci-pipelines%2Fci_stage_3.groovy;h=f9ca479244cbc30610ea4960cda6eb231944e228;hb=9054244cd2a7451f75157d7fa3ec5d2ff88176be;hp=8b4231c6eb1a7551209bc625a05f54b8ca59c418;hpb=69861b8e009aecb30a25045c803655c6654640b0;p=osm%2Fdevops.git diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index 8b4231c6..f9ca4792 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -30,8 +30,10 @@ properties([ string(defaultValue: '', description: '', name: 'UPSTREAM_JOB_NUMBER'), string(defaultValue: 'dpkg1', description: '', name: 'GPG_KEY_NAME'), string(defaultValue: 'artifactory-osm', description: '', name: 'ARTIFACTORY_SERVER'), + string(defaultValue: 'osm-stage_4', description: '', name: 'DOWNSTREAM_STAGE_NAME'), booleanParam(defaultValue: false, description: '', name: 'SAVE_CONTAINER_ON_FAIL'), - booleanParam(defaultValue: false, description: '', name: 'SAVE_CONTAINER_ON_PASS') + booleanParam(defaultValue: false, description: '', name: 'SAVE_CONTAINER_ON_PASS'), + booleanParam(defaultValue: false, description: '', name: 'DO_STAGE_4'), ]) ]) @@ -40,8 +42,6 @@ node("${params.NODE}") { sh 'env' tag_or_branch = params.GERRIT_BRANCH.replaceAll(/\./,"") - container_name_prefix = "osm-${tag_or_branch}" - container_name = "${container_name_prefix}-${BUILD_NUMBER}" stage("Checkout") { checkout scm @@ -54,11 +54,14 @@ node("${params.NODE}") { // upstream jobs always use merged artifacts upstream_main_job += '-merge' - + container_name_prefix = "osm-${tag_or_branch}" + container_name = "${container_name_prefix}" if ( JOB_NAME.contains('merge') ) { save_artifacts = true println("merge job, saving artifacts") + container_name += "-merge" } + container_name += "-${BUILD_NUMBER}" // Copy the artifacts from the upstream jobs stage("Copy Artifacts") { @@ -126,6 +129,12 @@ node("${params.NODE}") { // copy the public key into the release folder // this pulls the key from the home dir of the current user (jenkins) sh "cp ~/${REPO_KEY_NAME} ." + + // merge the change logs + sh """ + rm -f changelog/changelog-osm.html + [ ! -d changelog ] || for mdgchange in \$(ls changelog); do cat changelog/\$mdgchange >> changelog/changelog-osm.html; done + """ } // start an apache server to serve up the images http_server_name = "${container_name}-apache" @@ -180,11 +189,22 @@ node("${params.NODE}") { """ } - stage("Test") { + stage("Smoke") { ci_helper.systest_run(container_name, 'smoke') junit '*.xml' } + if ( params.DO_STAGE_4 ) { + stage("stage_4") { + def downstream_params = [ + string(name: 'CONTAINER_NAME', value: container_name), + ] + stage_4_result = build job: "${params.DOWNSTREAM_STAGE_NAME}/${GERRIT_BRANCH}", parameters: downstream_params, propagate: false + + currentBuild.result = stage_4_result.result + } + } + // save the artifacts of this build if this is a merge job if ( save_artifacts ) { stage("Archive") { @@ -199,6 +219,7 @@ node("${params.NODE}") { } } catch(caughtError) { + println("Caught error!") error = caughtError currentBuild.result = 'FAILURE' }