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:32:22 +0100
commit222a7d7f478bc61b2b6f56f77273fa23b31d8c82 (patch)
treee057b0f6121beb9a350a475c8fc4ded116ac5f94 /Jenkinsfile
parent2a50c5e3be873f459d6e854f540d30962ebe3b56 (diff)
downloadvyos-build-222a7d7f478bc61b2b6f56f77273fa23b31d8c82.tar.gz
vyos-build-222a7d7f478bc61b2b6f56f77273fa23b31d8c82.zip
Jenkins: add build option for AWS S3 snapshot bucket upload
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile16
1 files changed, 12 insertions, 4 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index f8a20b31..49e2bc64 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -109,6 +109,7 @@ pipeline {
string(name: 'BUILD_VERSION', defaultValue: '1.4-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 2 * * *')
@@ -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 {