Bug 1409 82/10182/3
authorbeierlm <mark.beierl@canonical.com>
Fri, 15 Jan 2021 16:09:15 +0000 (11:09 -0500)
committerbeierlm <mark.beierl@canonical.com>
Mon, 18 Jan 2021 19:23:56 +0000 (20:23 +0100)
Update the snapcraft dockerfile to ensure we use the latest on
each build.

Fixes Bug 1409

Change-Id: I762f46b82c6a6c1924560b4cfda4cfe7a416ccb3
Signed-off-by: beierlm <mark.beierl@canonical.com>
jenkins/ci-pipelines/ci_stage_2.groovy
jenkins/ci-pipelines/ci_stage_3.groovy

index 049763c..aa9c906 100644 (file)
@@ -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"
         }
     }
 
index 541213b..f482ee7 100644 (file)
@@ -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)+"/"