Skip to content

Commit

Permalink
pipeline: upload builds to S3
Browse files Browse the repository at this point in the history
This is a first step towards switching to S3. We still rsync to the
artifact server, but we also upload new builds to S3. Once we confirm
this works nicely, we can switch over to using `buildprep` and
completely wean off the artifact server.
  • Loading branch information
jlebon committed May 28, 2019
1 parent 0f8b227 commit 9aadab0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ properties([
])
])

def s3_builddir = "fcos-builds/prod/streams/${params.STREAM}"

podTemplate(cloud: 'openshift', label: 'coreos-assembler', yaml: pod, defaultContainer: 'jnlp') {
node('coreos-assembler') { container('coreos-assembler') {

Expand All @@ -43,12 +45,19 @@ podTemplate(cloud: 'openshift', label: 'coreos-assembler', yaml: pod, defaultCon
if (!devel) {
// make sure our cached version matches prod exactly before continuing
utils.rsync_in("builds", "builds")

/*
utils.shwrap("""
coreos-assembler buildprep s3://${s3_builddir}
""")
*/
}

utils.shwrap("""
git -C src/config pull
coreos-assembler fetch
""")

}

def prevBuildID = null
Expand Down Expand Up @@ -129,6 +138,12 @@ podTemplate(cloud: 'openshift', label: 'coreos-assembler', yaml: pod, defaultCon
// https://stackoverflow.com/questions/1636889
if (!devel) {
utils.rsync_out("builds", "builds")
if (utils.path_exists("/.aws")) {
// XXX: just upload as public-read for now
utils.shwrap("""
coreos-assembler upload s3 --acl=public-read ${s3_builddir}
""")
}
}
}
}}
Expand Down

0 comments on commit 9aadab0

Please sign in to comment.