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=""
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"
}
}
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)+"/"