-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*: setup AWS kola job & move aws replication to release job
Creates a new job specifically for running the kola tests on AWS. As a result moves the AWS replication out of the main `Jenkinsfile` into the `Jenkinsfile.release`. We'll likely have to move the AWS replication to it's own job down the line if we want to start signing the `meta.json` / `release.json` files.
- Loading branch information
Showing
4 changed files
with
121 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
def utils, streams | ||
node { | ||
checkout scm | ||
utils = load("utils.groovy") | ||
streams = load("streams.groovy") | ||
pod = readFile(file: "manifests/pod.yaml") | ||
} | ||
|
||
properties([ | ||
pipelineTriggers([]), | ||
parameters([ | ||
string(name: 'VERSION', | ||
description: 'Fedora CoreOS Build ID to test', | ||
defaultValue: '', | ||
trim: true), | ||
string(name: 'S3_STREAM_DIR', | ||
description: 'Fedora CoreOS S3 Stream Directory', | ||
defaultValue: '', | ||
trim: true) | ||
]) | ||
]) | ||
|
||
currentBuild.description = "[${params.VERSION}] Running" | ||
|
||
// substitute the right COSA image into the pod definition before spawning it | ||
pod = pod.replace("COREOS_ASSEMBLER_IMAGE", "coreos-assembler:master") | ||
|
||
podTemplate(cloud: 'openshift', label: 'coreos-assembler', yaml: pod, defaultContainer: 'jnlp') { | ||
node('coreos-assembler') { container('coreos-assembler') { | ||
def ami, ami_region | ||
def no_ami = false | ||
|
||
stage('Fetch Metadata') { | ||
utils.shwrap(""" | ||
coreos-assembler buildprep s3://${params.S3_STREAM_DIR}/builds | ||
""") | ||
|
||
def basearch = utils.shwrap_capture("coreos-assembler basearch") | ||
def meta_json = "builds/${params.VERSION}/${basearch}/meta.json" | ||
def meta = readJSON file: meta_json | ||
if (meta.amis.size() > 0) { | ||
ami = meta['amis'][0]['hvm'] | ||
ami_region = meta['amis'][0]['name'] | ||
} else { | ||
no_ami = true | ||
} | ||
} | ||
|
||
// fail immediately if the build contained no AMIs | ||
if (no_ami) { | ||
currentBuild.result = 'FAILURE' | ||
return | ||
} | ||
|
||
stage('AWS Kola Run') { | ||
utils.shwrap(""" | ||
kola run -p aws --aws-ami ${ami} --aws-region ${ami_region} -b fcos -j 10 || : | ||
tar -cf - _kola_temp/ | xz -c9 > _kola_temp.tar.xz | ||
""") | ||
archiveArtifacts "_kola_temp.tar.xz" | ||
} | ||
|
||
def report = readJSON file: "_kola_temp/aws-latest/reports/report.json" | ||
if (report["result"] != "PASS") { | ||
currentBuild.result = 'FAILURE' | ||
return | ||
} | ||
}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters