Add upload of snap package

pull/155/head
Åke Forslund 2020-04-29 07:56:02 +02:00
parent ba7511621e
commit d38fd20f3d
1 changed files with 16 additions and 2 deletions

18
Jenkinsfile vendored
View File

@ -64,7 +64,10 @@ pipeline {
}
}
}
stage('Build snap package') {
stage('Build and upload snap package') {
environment {
SNAP_LOGIN=credentials('snapcraft_login')
}
when {
anyOf {
branch 'dev'
@ -75,8 +78,19 @@ pipeline {
echo 'Building snap package...'
sh 'docker build -f ./devops/snapcraft/Dockerfile -t \
snapcraft-build .'
echo 'Building snap package...'
sh 'docker run -v "${PWD}":/build -w /build \
snapcraft-build:latest snapcraft'
snapcraft-build:latest snapcraft'
echo 'Pushing package to snap store'
sh('''
mkdir -p .snapcraft
cat ${SNAP_LOGIN} | base64 --decode --ignore-garbage \
> .snapcraft/snapcraft.cfg
docker run -v "${PWD}":/build -w /build \
snapcraft-build:latest snapcraft \
push --release edge *.snap
rm -rf .snapcraft
''')
}
}
}