summaryrefslogtreecommitdiff
path: root/Jenkinsfile
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-03-26 19:29:59 +0100
committerChristian Poessinger <christian@poessinger.com>2021-03-26 19:33:37 +0100
commited19a11152dce4c15422581199308cbce95d954c (patch)
treed45d7355ddeccc6a1477073cacfdd145f8d8ee9f /Jenkinsfile
parent7e104dbc56fbd713cd96cc5c1e136bb15635664b (diff)
downloadvyos-build-ed19a11152dce4c15422581199308cbce95d954c.tar.gz
vyos-build-ed19a11152dce4c15422581199308cbce95d954c.zip
Jenkins: add build option for AWS S3 snapshot bucket upload
(cherry picked from commit 222a7d7f478bc61b2b6f56f77273fa23b31d8c82)
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile16
1 files changed, 12 insertions, 4 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index dc07c0a2..967bf424 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -109,6 +109,7 @@ pipeline {
string(name: 'BUILD_VERSION', defaultValue: '1.3-rolling-' + env.TIMESTAMP, description: 'Version number (release builds only)')
booleanParam(name: 'BUILD_PUBLISH', defaultValue: true, description: 'Publish this build to downloads.vyos.io and AWS S3')
booleanParam(name: 'BUILD_SMOKETESTS', defaultValue: true, description: 'Include Smoketests in ISO image')
+ booleanParam(name: 'BUILD_SNAPSHOT', defaultValue: false, description: 'Upload image to AWS S3 snapshot bucket')
}
triggers {
cron('H 4 * * *')
@@ -199,12 +200,11 @@ pipeline {
// only deploy ISO if build from official repository
if (isCustomBuild())
return
- if (! params.BUILD_PUBLISH)
- return
files = findFiles(glob: 'build/vyos*.iso')
- if (files) {
- // publish build result, using SSH-dev.packages.vyos.net Jenkins Credentials
+ // Publish ISO image to daily builds bucket
+ if (files && params.BUILD_PUBLISH) {
+ // Publish build result, using SSH-dev.packages.vyos.net Jenkins Credentials
sshagent(['SSH-dev.packages.vyos.net']) {
dir('build') {
// build up some fancy groovy variables so we do not need to write/copy
@@ -233,6 +233,14 @@ pipeline {
toBucket: 's3-us.vyos.io', toPath: getGitBranchName() + '/vyos-rolling-latest.iso')
}
}
+
+ // Publish ISO image to snapshot bucket
+ if (files && params.BUILD_SNAPSHOT) {
+ withAWS(region: 'us-east-1', credentials: 's3-vyos-downloads-rolling-rw') {
+ s3Upload(bucket: 's3-us.vyos.io', path: 'snapshot/',
+ workingDir: 'build', includePathPattern: 'vyos*.iso')
+ }
+ }
}
}
failure {