diff --git a/Jenkinsfile.aws-test b/Jenkinsfile.aws-test index 566dbff30..e53abd931 100644 --- a/Jenkinsfile.aws-test +++ b/Jenkinsfile.aws-test @@ -22,6 +22,9 @@ node(NODE) { return } + // We're only ever triggered by the cloud job, so we know the latest build is in latest/ + // We immediately resolve it back to the specific images/ dir + def dirpath, version try { utils.inside_assembler_container("-v /srv:/srv") { stage("Sync In") { @@ -29,6 +32,13 @@ node(NODE) { string(credentialsId: params.ARTIFACT_SERVER, variable: 'ARTIFACT_SERVER'), sshUserPrivateKey(credentialsId: params.ARTIFACT_SSH_CREDS_ID, keyFileVariable: 'KEY_FILE'), ]) { + dirpath = "${images}/cloud/latest" + sh "mkdir -p ${dirpath}" + utils.rsync_file_in(ARTIFACT_SERVER, KEY_FILE, "${dirpath}/meta.json") + version = utils.sh_capture("jq -r '.[\"ostree-version\"]' ${dirpath}/meta.json") + # resolve to original dir to avoid races in the next rsync in + def imgv = utils.sh_capture("jq -r '.[\"image-version\"]' ${dirpath}/meta.json") + dirpath = "${images}/cloud/${imgv}" sh "mkdir -p ${dirpath}" utils.rsync_file_in(ARTIFACT_SERVER, KEY_FILE, "${dirpath}/aws-${AWS_REGION}.json") } @@ -44,10 +54,11 @@ node(NODE) { string(credentialsId: params.AWS_CI_ACCOUNT, variable: 'AWS_CI_ACCOUNT'), string(credentialsId: params.S3_PUBLIC_BUCKET, variable: 'S3_PUBLIC_BUCKET'), ]) { + def ami_intermediate = utils.sh_capture("jq -r .HVM ${dirpath}/aws-${AWS_REGION}.json") currentBuild.description = "version=${version} ami=${ami_intermediate}" sh """ # Do testing with intermediate aws image passed in by cloud job - if ! kola -b rhcos -p aws --aws-type ${aws_type} --tapfile rhcos-aws.tap --aws-ami ${ami_intermediate} --aws-region ${AWS_REGION} -j ${NUM_VMS} run; then + if ! kola -b rhcos -p aws --aws-type t2.small --tapfile rhcos-aws.tap --aws-ami ${ami_intermediate} --aws-region ${AWS_REGION} -j ${NUM_VMS} run; then exit 1 fi diff --git a/Jenkinsfile.cloud b/Jenkinsfile.cloud index b89b082a0..026c93ac0 100644 --- a/Jenkinsfile.cloud +++ b/Jenkinsfile.cloud @@ -251,13 +251,7 @@ node(NODE) { parallel par_stages; par_stages = [:] // Build the job responsible for testing and publishing the ami - def ami_intermediate = utils.sh_capture("jq -r .HVM ${dirpath}/aws-${AWS_REGION}.json") - build job: 'coreos-rhcos-aws-test', wait: false, parameters: [ - string(name: 'ami_intermediate', value: "${ami_intermediate}"), - string(name: 'version', value: "${version}"), - string(name: 'dirpath', value: "${dirpath}"), - string(name: 'aws_type', value: "t2.small") - ] + build job: 'coreos-rhcos-aws-test', wait: false } } catch (Throwable e) { currentBuild.result = 'FAILURE'