From 3c9586d2ea6e32940e9fa311de495520d26c719d Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Thu, 1 Jun 2017 15:51:30 -0400 Subject: Apex: fixes snapshot promotion be variables Since job names changed during the migration to multijob, we need to update the scripts which assume the the snapshot type is part of the job name. Moving them to be jjb variables instead and not rely on job name. Change-Id: I18f3bd5488c36b2f82a7bc7cb80045ab6807fa57 Signed-off-by: Tim Rozet --- jjb/apex/apex-snapshot-create.sh | 6 +++++- jjb/apex/apex-upload-artifact.sh | 5 ++++- jjb/apex/apex.yml | 16 ++++++++++++---- jjb/apex/apex.yml.j2 | 16 ++++++++++++---- 4 files changed, 33 insertions(+), 10 deletions(-) (limited to 'jjb/apex') diff --git a/jjb/apex/apex-snapshot-create.sh b/jjb/apex/apex-snapshot-create.sh index b2a39449e..342896c7d 100644 --- a/jjb/apex/apex-snapshot-create.sh +++ b/jjb/apex/apex-snapshot-create.sh @@ -13,7 +13,11 @@ set -o nounset set -o pipefail SSH_OPTIONS=(-o StrictHostKeyChecking=no -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null -o LogLevel=error) -SNAP_TYPE=$(echo ${JOB_NAME} | sed -n 's/^apex-\(.\+\)-promote.*$/\1/p') + +if [ -z "$SNAP_TYPE" ]; then + echo "ERROR: SNAP_TYPE not provided...exiting" + exit 1 +fi echo "Creating Apex snapshot..." echo "-------------------------" diff --git a/jjb/apex/apex-upload-artifact.sh b/jjb/apex/apex-upload-artifact.sh index 9d0b0148c..25870bb35 100755 --- a/jjb/apex/apex-upload-artifact.sh +++ b/jjb/apex/apex-upload-artifact.sh @@ -75,7 +75,10 @@ uploadrpm () { uploadsnap () { # Uploads snapshot artifact and updated properties file echo "Uploading snapshot artifacts" - SNAP_TYPE=$(echo ${JOB_NAME} | sed -n 's/^apex-\(.\+\)-promote.*$/\1/p') + if [ -z "$SNAP_TYPE" ]; then + echo "ERROR: SNAP_TYPE not provided...exiting" + exit 1 + fi gsutil cp $WORKSPACE/apex-${SNAP_TYPE}-snap-`date +%Y-%m-%d`.tar.gz gs://$GS_URL/ > gsutil.iso.log if [ "$SNAP_TYPE" == 'csit' ]; then gsutil cp $WORKSPACE/snapshot.properties gs://$GS_URL/snapshot.properties > gsutil.latest.log diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml index ab3df6e63..50502d77a 100644 --- a/jjb/apex/apex.yml +++ b/jjb/apex/apex.yml @@ -1181,7 +1181,9 @@ condition: SUCCESSFUL projects: - name: 'apex-create-snapshot' - current-parameters: true + current-parameters: false + predefined-parameters: | + SNAP_TYPE=csit node-parameters: true kill-phase-on: FAILURE abort-all-job: true @@ -1191,7 +1193,9 @@ condition: SUCCESSFUL projects: - name: 'apex-upload-snapshot' - current-parameters: true + current-parameters: false + predefined-parameters: | + SNAP_TYPE=csit node-parameters: true kill-phase-on: FAILURE abort-all-job: true @@ -1269,7 +1273,9 @@ condition: SUCCESSFUL projects: - name: 'apex-create-snapshot' - current-parameters: true + current-parameters: false + predefined-parameters: | + SNAP_TYPE=fdio node-parameters: true kill-phase-on: FAILURE abort-all-job: true @@ -1279,7 +1285,9 @@ condition: SUCCESSFUL projects: - name: 'apex-upload-snapshot' - current-parameters: true + current-parameters: false + predefined-parameters: | + SNAP_TYPE=fdio node-parameters: true kill-phase-on: FAILURE abort-all-job: true diff --git a/jjb/apex/apex.yml.j2 b/jjb/apex/apex.yml.j2 index b040ba5bf..84a899f57 100644 --- a/jjb/apex/apex.yml.j2 +++ b/jjb/apex/apex.yml.j2 @@ -820,7 +820,9 @@ condition: SUCCESSFUL projects: - name: 'apex-create-snapshot' - current-parameters: true + current-parameters: false + predefined-parameters: | + SNAP_TYPE=csit node-parameters: true kill-phase-on: FAILURE abort-all-job: true @@ -830,7 +832,9 @@ condition: SUCCESSFUL projects: - name: 'apex-upload-snapshot' - current-parameters: true + current-parameters: false + predefined-parameters: | + SNAP_TYPE=csit node-parameters: true kill-phase-on: FAILURE abort-all-job: true @@ -908,7 +912,9 @@ condition: SUCCESSFUL projects: - name: 'apex-create-snapshot' - current-parameters: true + current-parameters: false + predefined-parameters: | + SNAP_TYPE=fdio node-parameters: true kill-phase-on: FAILURE abort-all-job: true @@ -918,7 +924,9 @@ condition: SUCCESSFUL projects: - name: 'apex-upload-snapshot' - current-parameters: true + current-parameters: false + predefined-parameters: | + SNAP_TYPE=fdio node-parameters: true kill-phase-on: FAILURE abort-all-job: true -- cgit 1.2.3-korg