Apex: fixes iso verify 51/33551/3
authorTim Rozet <trozet@redhat.com>
Wed, 19 Apr 2017 17:10:45 +0000 (13:10 -0400)
committerTim Rozet <trozet@redhat.com>
Wed, 19 Apr 2017 17:21:22 +0000 (13:21 -0400)
Change-Id: I2aeca682d6543b36cd8b28f78580c4194db85453
Signed-off-by: Tim Rozet <trozet@redhat.com>
jjb/apex/apex-upload-artifact.sh
jjb/apex/apex.yml

index 4a2a64d..e93a46b 100755 (executable)
@@ -3,8 +3,13 @@ set -o errexit
 set -o nounset
 set -o pipefail
 
+if [ -z "$ARTIFACT_TYPE" ]; then
+  echo "ERROR: ARTIFACT_TYPE not provided...exiting"
+  exit 1
+fi
+
 # log info to console
-echo "Uploading the Apex $1 artifact. This could take some time..."
+echo "Uploading the Apex ${ARTIFACT_TYPE} artifact. This could take some time..."
 echo "--------------------------------------------------------"
 echo
 
@@ -84,25 +89,25 @@ uploadsnap () {
   echo "Upload complete for Snapshot"
 }
 
-if echo $WORKSPACE | grep promote > /dev/null; then
+if [ "$ARTIFACT_TYPE" == 'snapshot' ]; then
   uploadsnap
 elif gpg2 --list-keys | grep "opnfv-helpdesk@rt.linuxfoundation.org"; then
   echo "Signing Key avaliable"
-  if [ $1 == 'iso' ]; then
+  if [ "$ARTIFACT_TYPE" == 'iso' ]; then
     signiso
     uploadiso
   fi
-  if [ $1 == 'rpm' ]; then
+  if [ "$ARTIFACT_TYPE" == 'rpm' ]; then
     signrpm
     uploadrpm
   fi
 else
-  if [ $1 == 'iso' ]; then uploadiso; fi
-  if [ $1 == 'rpm' ]; then uploadrpm; fi
+  if [ "$ARTIFACT_TYPE" == 'iso' ]; then uploadiso; fi
+  if [ "$ARTIFACT_TYPE" == 'rpm' ]; then uploadrpm; fi
 fi
 
 echo
 echo "--------------------------------------------------------"
 echo "Done!"
-if [ $1 == 'iso' ]; then echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"; fi
-if [ $1 == 'rpm' ]; then echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"; fi
+if [ "$ARTIFACT_TYPE" == 'iso' ]; then echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"; fi
+if [ "$ARTIFACT_TYPE" == 'rpm' ]; then echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"; fi
index 37bbbb6..248f296 100644 (file)
@@ -12,6 +12,7 @@
         - 'apex-daily-{stream}'
         - 'apex-csit-promote-daily-{stream}'
         - 'apex-fdio-promote-daily-{stream}'
+        - 'apex-verify-iso-{stream}'
 
     # stream:    branch with - in place of / (eg. stable-arno)
     # branch:    branch (eg. stable/arno)
             block: true
         - 'apex-upload-rpm-artifact'
         - trigger-builds:
-          - project: 'apex-iso-verify-{stream}'
+          - project: 'apex-verify-iso-{stream}'
             predefined-parameters: |
               BUILD_DIRECTORY=apex-build-{stream}/.build
-              OPNFV_CLEAN=yes
             git-revision: false
             block: true
             same-node: true
         - 'apex-upload-iso-artifact'
 
+# ISO verify job
+- job-template:
+    name: 'apex-verify-iso-{stream}'
+
+    # Job template for builds
+    #
+    # Required Variables:
+    #     stream:    branch with - in place of / (eg. stable)
+    #     branch:    branch (eg. stable)
+    node: '{daily-slave}'
+
+    disabled: false
+
+    concurrent: true
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+            branch: '{branch}'
+        - apex-parameter:
+            gs-pathname: '{gs-pathname}'
+        - string:
+            name: GIT_BASE
+            default: https://gerrit.opnfv.org/gerrit/$PROJECT
+            description: "Used for overriding the GIT URL coming from parameters macro."
+
+    scm:
+        - git-scm
+
+    properties:
+        - logrotate-default
+        - build-blocker:
+            use-build-blocker: true
+            block-level: 'NODE'
+            blocking-jobs:
+                - 'apex-deploy.*'
+        - throttle:
+            max-per-node: 1
+            max-total: 10
+            option: 'project'
+
+    builders:
+        - 'apex-iso-verify'
+
 - job-template:
     name: 'apex-deploy-virtual-{scenario}-{stream}'
 
             !include-raw: ./apex-iso-verify.sh
 
 - builder:
-    name: 'apex-upload-snapshot-artifact'
+    name: 'apex-upload-rpm-artifact'
     builders:
-        - shell: ./apex-upload-artifact.sh snapshot
+        - inject:
+           properties-content: ARTIFACT_TYPE=rpm
+           script-content:
+             !include-raw: ./apex-upload-artifact.sh
 
 - builder:
     name: 'apex-upload-iso-artifact'
     builders:
-        - shell: ./apex-upload-artifact.sh iso
+        - inject:
+           properties-content: ARTIFACT_TYPE=iso
+           script-content:
+             !include-raw: ./apex-upload-artifact.sh
 
 - builder:
-    name: 'apex-upload-rpm-artifact'
+    name: 'apex-upload-snapshot-artifact'
     builders:
-        - shell: ./apex-upload-artifact.sh rpm
+        - inject:
+           properties-content: ARTIFACT_TYPE=snapshot
+           script-content:
+             !include-raw: ./apex-upload-artifact.sh
 
 - builder:
     name: 'apex-gs-cleanup'