File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments