Skip to content

Commit

Permalink
cloud: Don't actually call it -tested.json until it is
Browse files Browse the repository at this point in the history
I found it misleading that the `cloud` job uploaded the AMI JSON
metadata with `-smoketested.json` appended *before* it was even tested.
Let's make this clearer by keeping that suffix off until it's actually
true.
  • Loading branch information
jlebon committed Sep 25, 2018
1 parent 36b7f50 commit ab58be5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Jenkinsfile.aws-test
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ node(NODE) {
sshUserPrivateKey(credentialsId: params.ARTIFACT_SSH_CREDS_ID, keyFileVariable: 'KEY_FILE'),
]) {
sh "mkdir -p ${dirpath}"
utils.rsync_file_in(ARTIFACT_SERVER, KEY_FILE, "${dirpath}/aws-${AWS_REGION}-smoketested.json")
utils.rsync_file_in(ARTIFACT_SERVER, KEY_FILE, "${dirpath}/aws-${AWS_REGION}.json")
}
}

Expand All @@ -53,12 +53,12 @@ node(NODE) {
# Tests pass, tag the json in the artifact server to a persistent location
# and give launch permissions to OpenShift CI
export AWS_DEFAULT_REGION=${AWS_REGION}
if [ ! -e ${dirpath}/aws-${AWS_REGION}-smoketested.json ]; then
echo "Cannot find smoketested json artifact."
if [ ! -e ${dirpath}/aws-${AWS_REGION}.json ]; then
echo "Cannot find JSON artifact."
exit 1
fi

cp ${dirpath}/aws-${AWS_REGION}-smoketested.json ${images}/aws-${AWS_REGION}-tested.json
cp ${dirpath}/aws-${AWS_REGION}.json ${images}/aws-${AWS_REGION}-tested.json
aws ec2 modify-image-attribute \
--image-id ${ami_intermediate} \
--launch-permission '{"Add":[{"Group":"all"}]}'
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile.cloud
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ node(NODE) {
string(credentialsId: params.AWS_CI_ACCOUNT, variable: 'AWS_CI_ACCOUNT'),
]) {
sh """
amijson=${dirpath}/aws-${AWS_REGION}-smoketested.json
amijson=${dirpath}/aws-${AWS_REGION}.json
ore aws upload --region ${AWS_REGION} \
--ami-name 'rhcos_dev_${commit[0..6]}' \
--ami-description 'Red Hat CoreOS ${version} (${commit})' \
Expand Down Expand Up @@ -251,7 +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}-smoketested.json")
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}"),
Expand Down

0 comments on commit ab58be5

Please sign in to comment.