adding the apex virtual deploy job 19/2719/4
authorDan Radez <dradez@redhat.com>
Thu, 22 Oct 2015 19:57:03 +0000 (15:57 -0400)
committerDan Radez <dradez@redhat.com>
Tue, 27 Oct 2015 01:03:55 +0000 (21:03 -0400)
Change-Id: I8e547ed70e486006e3db07768572de577e0daa12
Signed-off-by: Dan Radez <dradez@redhat.com>
jjb/apex/apex.yml

index 7a79a37..bf6d5e5 100644 (file)
@@ -76,6 +76,7 @@
 
     builders:
         - 'apex-build'
+        - 'apex-deploy-virtual'
         - 'apex-workspace-cleanup'
 
 - job-template:
 
     builders:
         - 'apex-build'
+        - 'apex-deploy-virtual'
         - 'apex-workspace-cleanup'
 
 - job-template:
         - 'apex-build'
         - 'apex-upload-artifact'
         - 'apex-workspace-cleanup'
+        - 'apex-deploy-virtual'
+        - 'apex-workspace-cleanup'
 
 ########################
 # parameter macros
             echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
             echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
 
+- builder:
+    name: 'apex-deploy-virtual'
+    builders:
+        - shell: |
+            #!/bin/bash
+            set -o errexit
+            set -o nounset
+            set -o pipefail
+
+            # log info to console
+            echo "Starting the Apex virtual deployment."
+            echo "--------------------------------------------------------"
+            echo
+
+            # check if we got the file
+            if [[ -f opnfv.properties ]]; then
+                # source the file so we get OPNFV vars
+                source opnfv.properties
+                RPM_INSTALL_PATH=noarch/$(basepath RPM_URL)
+            else
+                # get the latest.properties file in order to get info regarding latest artifact
+                curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
+                [[ -f opnfv.properties ]] || exit 1
+
+                # source the file so we get OPNFV vars
+                source opnfv.properties
+                RPM_INSTALL_PATH=$RPM_URL
+            fi
+
+            # update / install the new rpm
+            if rpm -q opnfv-apex; then
+               sudo yum update -y $RPM_INSTALL_PATH;
+            else
+               sudo yum install -y $RPM_INSTALL_PATH;
+            fi
+
+            # cleanup virtual machines before we start
+            sudo opnfv-clean
+            # initiate virtual deployment
+            sudo opnfv-deploy -v
+
+            echo
+            echo "--------------------------------------------------------"
+            echo "Done!"
 
 #######################
 # trigger macros