Skip to content

Commit d38fd20

Browse files
committed
Add upload of snap package
1 parent ba75116 commit d38fd20

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Jenkinsfile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ pipeline {
6464
}
6565
}
6666
}
67-
stage('Build snap package') {
67+
stage('Build and upload snap package') {
68+
environment {
69+
SNAP_LOGIN=credentials('snapcraft_login')
70+
}
6871
when {
6972
anyOf {
7073
branch 'dev'
@@ -75,8 +78,19 @@ pipeline {
7578
echo 'Building snap package...'
7679
sh 'docker build -f ./devops/snapcraft/Dockerfile -t \
7780
snapcraft-build .'
81+
echo 'Building snap package...'
7882
sh 'docker run -v "${PWD}":/build -w /build \
79-
snapcraft-build:latest snapcraft'
83+
snapcraft-build:latest snapcraft'
84+
echo 'Pushing package to snap store'
85+
sh('''
86+
mkdir -p .snapcraft
87+
cat ${SNAP_LOGIN} | base64 --decode --ignore-garbage \
88+
> .snapcraft/snapcraft.cfg
89+
docker run -v "${PWD}":/build -w /build \
90+
snapcraft-build:latest snapcraft \
91+
push --release edge *.snap
92+
rm -rf .snapcraft
93+
''')
8094
}
8195
}
8296
}

0 commit comments

Comments
 (0)