apex: parameterizes deploys with scenarios 01/6901/3
authorTim Rozet <trozet@redhat.com>
Fri, 15 Jan 2016 16:52:57 +0000 (11:52 -0500)
committerTim Rozet <trozet@redhat.com>
Fri, 15 Jan 2016 17:16:26 +0000 (12:16 -0500)
Since we have all in one builds, we only need to be able to use
different scenarios when deploying.  This patch creates several scenario
deploy jobs, then modifies our verify and daily to only use odl_l2
scenario, and we can add more when they are working/supported.

Change-Id: Id163f3ba40466630f7b55f0795362248056f6a12
Signed-off-by: Tim Rozet <trozet@redhat.com>
jjb/apex/apex.yml

index e8064fc..c85d255 100644 (file)
@@ -4,8 +4,8 @@
         - 'apex-verify-{stream}'
         - 'apex-merge-{stream}'
         - 'apex-build-{stream}'
-        - 'apex-deploy-virtual-{stream}'
-        - 'apex-deploy-baremetal-{stream}'
+        - 'apex-deploy-virtual-{scenario}-{stream}'
+        - 'apex-deploy-baremetal-{scenario}-{stream}'
         - 'apex-daily-{stream}'
 
     # stream:    branch with - in place of / (eg. stable-arno)
         - brahmaputra:
             branch: 'stable/brahmaputra'
             gs-pathname: '/brahmaputra'
+            disabled: true
 
     project: 'apex'
 
+    scenario:
+         - 'os-odl_l2-nofeature-ha'
+         - 'os-odl_l2-sfc-ha'
+         - 'os-odl_l3-nofeature-ha'
+         - 'os-onos-nofeature-ha'
+         - 'os-opencontrail-nofeature-ha'
+
 - job-template:
     name: 'apex-verify-{stream}'
 
@@ -28,7 +36,6 @@
     parameters:
         - apex-parameter:
             gs-pathname: '{gs-pathname}'
-            ARTIFACT_VERSION: 'dev'
         - project-parameter:
             project: '{project}'
         - gerrit-parameter:
 
     builders:
         - 'apex-build'
-        - 'apex-deploy-virtual'
+        - trigger-builds:
+          - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
+            predefined-parameters:
+              DEPLOY_SCENARIO="os-odl_l2-nofeature-ha"
+            git-revision: true
+            block: true
         - 'apex-workspace-cleanup'
 
 - job-template:
         - 'apex-workspace-cleanup'
 
 - job-template:
-    name: 'apex-deploy-virtual-{stream}'
+    name: 'apex-deploy-virtual-{scenario}-{stream}'
 
     # Job template for virtual deployment
     #
             project: '{project}'
         - apex-parameter:
             gs-pathname: '{gs-pathname}'
+        - string:
+            name: DEPLOY_SCENARIO
+            default: '{scenario}'
+            description: "Scenario to deploy with."
 
     properties:
         - build-blocker:
         - 'apex-workspace-cleanup'
 
 - job-template:
-    name: 'apex-deploy-baremetal-{stream}'
+    name: 'apex-deploy-baremetal-{scenario}-{stream}'
 
     # Job template for baremetal deployment
     #
             project: '{project}'
         - apex-parameter:
             gs-pathname: '{gs-pathname}'
+        - string:
+            name: DEPLOY_SCENARIO
+            default: '{scenario}'
+            description: "Scenario to deploy with."
 
     properties:
         - build-blocker:
             current-parameters: true
             block: true
         - trigger-builds:
-          - project: 'apex-deploy-baremetal-{stream}'
+          - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
+            predefined-parameters:
+              DEPLOY_SCENARIO="os-odl_l2-nofeature-ha"
             git-revision: true
             block: true
         - trigger-builds:
             # cleanup virtual machines before we start
             sudo opnfv-clean
             # initiate virtual deployment
-            if [ -e /usr/share/doc/opnfv/network_settings.yaml.example ]; then
-              sudo opnfv-deploy -v -d /usr/share/doc/opnfv/deploy_settings.yaml.example -n /usr/share/doc/opnfv/network_settings.yaml.example
+            if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
+              if [ -n "$DEPLOY_SCENARIO" ]; then
+                echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
+                if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
+                  sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml
+                else
+                  echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
+                  exit 1
+                fi
+              else
+                echo "Deploy scenario not set!"
+                exit 1
             else
               sudo opnfv-deploy -v
             fi
             # cleanup environment before we start
             sudo opnfv-clean
             # initiate baremetal deployment
-            sudo opnfv-deploy -i  /root/inventory/pod_settings.yaml \
-            -d /usr/share/doc/opnfv/deploy_settings.yaml.example \
-            -n /root/network/network_settings.yaml
+            if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
+              if [ -n "$DEPLOY_SCENARIO" ]; then
+                echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
+                if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
+                  sudo opnfv-deploy -i  /root/inventory/pod_settings.yaml \
+                  -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
+                  -n /root/network_settings.yaml
+                else
+                  echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
+                  exit 1
+                fi
+              else
+                echo "Deploy scenario not set!"
+                exit 1
+            else
+              echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
+              exit 1
+            fi
 
             echo
             echo "--------------------------------------------------------"