@@ -19,7 +19,19 @@ properties([
19
19
string(name: 'VERSION',
20
20
description: 'Fedora CoreOS version to release',
21
21
defaultValue: '',
22
- trim: true)
22
+ trim: true),
23
+ // Default to true for AWS_REPLICATION because the only case
24
+ // where we are running the job by hand is when we're doing a
25
+ // production release and we want to replicate there. Defaulting
26
+ // to true means there is less opportunity for human error.
27
+ //
28
+ // use a string here because passing booleans via `oc start-build -e`
29
+ // is non-trivial
30
+ choice(name: 'AWS_REPLICATION',
31
+ choices: (['true'] + ['false']),
32
+ defaultValue: 'true',
33
+ description: 'Force AWS AMI replication',
34
+ required: false)
23
35
])
24
36
])
25
37
@@ -30,25 +42,27 @@ pod = pod.replace("COREOS_ASSEMBLER_IMAGE", "coreos-assembler:master")
30
42
31
43
podTemplate(cloud: 'openshift', label: 'coreos-assembler', yaml: pod, defaultContainer: 'jnlp') {
32
44
node('coreos-assembler') { container('coreos-assembler') {
33
- // Replicate the newly uploaded AMI to other regions. Intentionally
34
- // split out from the 'Upload AWS' stage to allow for tests to be added
35
- // at a later date before replicating said image.
36
- //
37
- // We have to re-run the coreos-meta-translator as aws-replicate
38
- // only modifies the meta.json
39
- stage('Replicate AWS AMI') {
40
- s3_stream_dir = "${s3_bucket}/prod/streams/${params.STREAM}"
41
- // TODO: Once buildprep supports pulling specific builds
42
- // operate on the specific build rather than the most
43
- // recent build
44
- utils.shwrap("""
45
- export AWS_CONFIG_FILE=\${AWS_FCOS_BUILDS_BOT_CONFIG}
46
- coreos-assembler buildprep s3://${s3_stream_dir}/builds
47
- coreos-assembler aws-replicate --build=${params.VERSION}
48
- git clone https://github.com/coreos/fedora-coreos-releng-automation /var/tmp/fcos-releng
49
- /var/tmp/fcos-releng/coreos-meta-translator/trans.py --workdir .
50
- coreos-assembler buildupload --skip-builds-json s3 --acl=public-read ${s3_stream_dir}/builds
51
- """)
45
+ if (params.AWS_REPLICATION == 'true') {
46
+ // Replicate the newly uploaded AMI to other regions. Intentionally
47
+ // split out from the 'Upload AWS' stage to allow for tests to be added
48
+ // at a later date before replicating said image.
49
+ //
50
+ // We have to re-run the coreos-meta-translator as aws-replicate
51
+ // only modifies the meta.json
52
+ stage('Replicate AWS AMI') {
53
+ s3_stream_dir = "${s3_bucket}/prod/streams/${params.STREAM}"
54
+ // TODO: Once buildprep supports pulling specific builds
55
+ // operate on the specific build rather than the most
56
+ // recent build
57
+ utils.shwrap("""
58
+ export AWS_CONFIG_FILE=\${AWS_FCOS_BUILDS_BOT_CONFIG}
59
+ coreos-assembler buildprep s3://${s3_stream_dir}/builds
60
+ coreos-assembler aws-replicate --build=${params.VERSION}
61
+ git clone https://github.com/coreos/fedora-coreos-releng-automation /var/tmp/fcos-releng
62
+ /var/tmp/fcos-releng/coreos-meta-translator/trans.py --workdir .
63
+ coreos-assembler buildupload --skip-builds-json s3 --acl=public-read ${s3_stream_dir}/builds
64
+ """)
65
+ }
52
66
}
53
67
54
68
stage('Publish') {
0 commit comments