Ensure clean snap
[osm/devops.git] / jenkins / ci-pipelines / ci_stage_2.groovy
index aa9c906..5cad17b 100644 (file)
@@ -83,6 +83,7 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,do_stage_3,artifa
         stage('Snap build') {
             sh "docker pull snapcore/snapcraft:stable"
             sh "sudo rm -rf ${WORKSPACE}/stage/ ${WORKSPACE}/parts/ ${WORKSPACE}/prime/ ${WORKSPACE}/*.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/"