- stage('Archive') {
- sh(returnStdout:true, script: 'devops-stages/stage-archive.sh').trim()
- ci_helper.archive(mdg,branch,'untested')
- }
+ if (fileExists('snap/snapcraft.yaml')) {
+ stage('Snap build') {
+ withCredentials([string(credentialsId: 'Snapstore', variable: 'SNAPCRAFT_STORE_CREDENTIALS')]) {
+ 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/"