From: beierlm Date: Fri, 15 Jan 2021 16:09:15 +0000 (-0500) Subject: Bug 1409 X-Git-Tag: branch-sol006v331-start~78 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=1c6e339d1fad4180db07b7e068e28348679d11b2;p=osm%2Fdevops.git Bug 1409 Update the snapcraft dockerfile to ensure we use the latest on each build. Fixes Bug 1409 Change-Id: I762f46b82c6a6c1924560b4cfda4cfe7a416ccb3 Signed-off-by: beierlm --- diff --git a/jenkins/ci-pipelines/ci_stage_2.groovy b/jenkins/ci-pipelines/ci_stage_2.groovy index 049763c6..aa9c906a 100644 --- a/jenkins/ci-pipelines/ci_stage_2.groovy +++ b/jenkins/ci-pipelines/ci_stage_2.groovy @@ -81,9 +81,10 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,do_stage_3,artifa 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 "snapcraft --use-lxd" + sh "mv ${WORKSPACE}/${mdg}_*.snap ${WORKSPACE}/${mdg}.snap" sh "sudo rm -rf ${WORKSPACE}/stage/ ${WORKSPACE}/parts/ ${WORKSPACE}/prime/" REV="" @@ -100,6 +101,7 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,do_stage_3,artifa 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" } } diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index 541213b4..f482ee74 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -519,6 +519,7 @@ EOF""" stage("Snap promotion") { def snaps = ["osmclient"] for (snap in snaps) { + sh "docker pull snapcore/snapcraft:stable" channel="" if (BRANCH_NAME.startsWith("v")) { channel=BRANCH_NAME.substring(1)+"/"