From 9aadab063d5b63af73433dea0db3bd4a9a8fce18 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Tue, 28 May 2019 11:48:25 -0400 Subject: [PATCH] pipeline: upload builds to S3 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. --- Jenkinsfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 7bacd929d..497f6d3b4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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') { @@ -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 @@ -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} + """) + } } } }}