Merge "jjb: xci: xci-verify-jobs: Use clean vm to verify XCI jobs"
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Mon, 25 Sep 2017 19:30:07 +0000 (19:30 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Mon, 25 Sep 2017 19:30:07 +0000 (19:30 +0000)
jjb/xci/xci-verify-jobs.yml

index 440fac7..efc8995 100644 (file)
 # distros
 #--------------------------------
     distro:
-        - 'xenial':
+        - 'ubuntu':
             disabled: false
-        - 'centos7':
+        - 'centos':
             disabled: true
-        - 'suse':
+        - 'opensuse':
             disabled: true
 #--------------------------------
 # type
         - build-blocker:
             use-build-blocker: true
             blocking-jobs:
-                - 'xci-verify-.*'
-                - 'bifrost-verify-.*'
-                - 'bifrost-periodic-.*'
-                - 'osa-verify-.*'
-                - 'osa-periodic-.*'
+                - 'xci-verify-{distro}-.*'
+                - 'bifrost-verify-{distro}-.*'
+                - 'bifrost-periodic-{distro}-.*'
+                - 'osa-verify-{distro}-.*'
+                - 'osa-periodic-{distro}-.*'
             block-level: 'NODE'
 
     wrappers:
             branch: '{branch}'
         - label:
             name: SLAVE_LABEL
-            default: 'xci-virtual-{distro}'
+            default: 'xci-virtual'
         - string:
             name: CLEAN_DIB_IMAGES
             default: 'true'
     parameters:
         - string:
             name: DISTRO
-            default: 'xenial'
+            default: 'ubuntu'
         - string:
             name: DEPLOY_SCENARIO
             default: 'os-nosdn-nofeature-noha'
 
     builders:
         - description-setter:
-            description: "Built on $NODE_NAME"
+            description: "Built on $NODE_NAME for $DISTRO"
         - 'xci-verify-{phase}-macro'
 
 #--------------------------------
                 exit 0
             fi
 
-            # for some reason, the PATH is not set correctly
-            # setting PATH for ansible stuff
-            export PATH=/home/jenkins/.local/bin:$PATH
+            cd $WORKSPACE
+            ./xci/scripts/vm/start-new-vm.sh $DISTRO
+        - shell: |
+            #!/bin/bash
+
+            # skip the deployment if the patch doesn't impact the deployment
+            if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
+                echo "Skipping the deployment!"
+                exit 0
+            fi
 
-            cd $WORKSPACE/xci
-            ./xci-deploy.sh
+            ssh ${DISTRO}_xci_vm "cd releng-xci/xci && ./xci-deploy.sh"
 
 
 - builder:
             fi
 
             echo "Hello World!"
+        - shell: |
+            #!/bin/bash
+
+            # skip the deployment if the patch doesn't impact the deployment
+            if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
+                echo "Skipping the deployment!"
+                exit 0
+            fi
+
+            sudo virsh destroy $DISTRO
+            sudo virsh undefine $DISTRO
 
 # this will be enabled once the xci is prepared
 #- builder: