println("TEST_INSTALL = ${params.TEST_INSTALL}, downstream job: ${downstream_job_name}")
currentBuild.result = 'SUCCESS'
try {
- stage_3_merge_result = build job: "${downstream_job_name}", parameters: downstream_params, propagate: true
+ stage_3_merge_result = build job: "${downstream_job_name}", parameters: downstream_params, propagate: true
if (stage_3_merge_result.getResult() != 'SUCCESS') {
project = stage_3_merge_result.getProjectName()
build = stage_3_merge_result.getNumber()
// error("${project} build ${build} failed")
currentBuild.result = stage_3_merge_result.getResult()
}
- }
- catch(caughtError) {
- echo 'Exception in stage_1'
- currentBuild.result = 'FAILURE'
- }
- finally {
- try {
- if((currentBuild.result != 'SUCCESS') && (env.JOB_NAME == 'daily-stage_4')){
- emailext (
- subject: "[OSM-Jenkins] Job: ${env.JOB_NAME} Build: ${env.BUILD_NUMBER} Result: ${currentBuild.result}",
- body: """ Check console output at "${env.BUILD_URL}" """,
- to: 'OSM_MDL@list.etsi.org',
- recipientProviders: [culprits()]
- )
+ }
+ catch(caughtError) {
+ echo 'Exception in stage_1'
+ currentBuild.result = 'FAILURE'
+ }
+ finally {
+ try {
+ if((currentBuild.result != 'SUCCESS') && (env.JOB_NAME == 'daily-stage_4')){
+ emailext (
+ subject: "[OSM-Jenkins] Job: ${env.JOB_NAME} Build: ${env.BUILD_NUMBER} Result: ${currentBuild.result}",
+ body: """ Check console output at "${env.BUILD_URL}" """,
+ to: 'OSM_MDL@list.etsi.org',
+ recipientProviders: [culprits()]
+ )
+ }
}
- }
- catch(caughtError) {
- echo "Failure in executing email"
- }
-
- }
- }
+ catch(caughtError) {
+ echo "Failure in executing email"
+ }
+ }
+ }
+}
-
- }
if (fileExists('snap/snapcraft.yaml')) {
stage('Snap build') {
+ sh "docker pull snapcore/snapcraft:stable"
sh "sudo rm -rf ${WORKSPACE}/stage/ ${WORKSPACE}/parts/ ${WORKSPACE}/prime/ ${WORKSPACE}/*.snap"
- sh "docker run -v ${WORKSPACE}:/build --env BRANCH=${BRANCH_NAME} -w /build snapcore/snapcraft:stable /bin/bash -c 'apt update && snapcraft'"
- sh "sudo mv ${WORKSPACE}/${mdg}_*.snap ${WORKSPACE}/${mdg}.snap"
+ sh "sudo snapcraft clean --use-lxd"
+ sh "snapcraft --use-lxd"
+ sh "mv ${WORKSPACE}/${mdg}_*.snap ${WORKSPACE}/${mdg}.snap"
sh "sudo rm -rf ${WORKSPACE}/stage/ ${WORKSPACE}/parts/ ${WORKSPACE}/prime/"
REV=""
if ( !JOB_NAME.contains('merge') ) {
- short_ref=sh(returnStdout: true,
- script: "git rev-parse --short HEAD").trim()
- REV="/"+short_ref
+ REV="/"+"${GERRIT_REFSPEC}".replaceAll('/','-')
}
channel="latest"
if (BRANCH_NAME.startsWith("v")) {
sh "sudo docker run -v ~/.snapcraft:/snapcraft -v ${WORKSPACE}:/build " +
"-w /build snapcore/snapcraft:stable /bin/bash -c " +
"\"snapcraft login --with /snapcraft/config ; snapcraft push --release=${channel}/edge${REV} ${mdg}.snap\""
+ sh "sudo rm -rf ${WORKSPACE}/*.snap"
}
}
string(defaultValue: 'artifactory-osm', description: '', name: 'ARTIFACTORY_SERVER'),
string(defaultValue: 'osm-stage_4', description: '', name: 'DOWNSTREAM_STAGE_NAME'),
string(defaultValue: 'testing-daily', description: '', name: 'DOCKER_TAG'),
- booleanParam(defaultValue: true, description: '', name: 'SAVE_CONTAINER_ON_FAIL'),
+ booleanParam(defaultValue: false, description: '', name: 'SAVE_CONTAINER_ON_FAIL'),
booleanParam(defaultValue: false, description: '', name: 'SAVE_CONTAINER_ON_PASS'),
booleanParam(defaultValue: true, description: '', name: 'SAVE_ARTIFACTS_ON_SMOKE_SUCCESS'),
booleanParam(defaultValue: true, description: '', name: 'DO_STAGE_4'),