Apex: fixes snapshot promotion be variables 85/35685/1
authorTim Rozet <trozet@redhat.com>
Thu, 1 Jun 2017 19:51:30 +0000 (15:51 -0400)
committerTim Rozet <trozet@redhat.com>
Thu, 1 Jun 2017 19:51:30 +0000 (15:51 -0400)
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 <trozet@redhat.com>
jjb/apex/apex-snapshot-create.sh
jjb/apex/apex-upload-artifact.sh
jjb/apex/apex.yml
jjb/apex/apex.yml.j2

index b2a3944..342896c 100644 (file)
@@ -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 "-------------------------"
index 9d0b014..25870bb 100755 (executable)
@@ -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
index ab3df6e..50502d7 100644 (file)
             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
             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
             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
             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
index b040ba5..84a899f 100644 (file)
             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
             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
             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
             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