[compass] enable virtual-deployment workflow 49/7549/11
authormeimei <meimei@huawei.com>
Thu, 21 Jan 2016 06:43:01 +0000 (14:43 +0800)
committermei mei <meimei@huawei.com>
Sat, 23 Jan 2016 02:26:12 +0000 (02:26 +0000)
Change-Id: I2ab9c1d880b7286343ab0e2e8456dddd25378a7b
Signed-off-by: meimei <meimei@huawei.com>
jjb/compass4nfv/compass-ci-jobs.yml
jjb/compass4nfv/compass-deploy.sh [new file with mode: 0644]
jjb/compass4nfv/compass-project-jobs.yml

index 64a4b31..f43ab59 100644 (file)
 #--------------------------------
         - huawei-us-deploy-bare-1:
             <<: *brahmaputra
+        - huawei-virtual:
+            <<: *brahmaputra
 #--------------------------------
 #        master
 #--------------------------------
         - intel-pod8:
             <<: *master
+        - huawei-virtual:
+            <<: *master
 
     scenario:
         - 'os-nosdn-nofeature-ha':
             condition: COMPLETED
             projects:
                 - name: 'functest-compass-{pod}-daily-{stream}'
-                  current-parameters: false
+                  current-parameters: true
                   predefined-parameters: 'DEPLOY_SCENARIO={scenario}'
                   kill-phase-on: NEVER
         - multijob:
             condition: COMPLETED
             projects:
                 - name: 'yardstick-compass-{pod}-daily-{stream}'
-                  current-parameters: false
+                  current-parameters: true
                   predefined-parameters: 'DEPLOY_SCENARIO={scenario}'
                   kill-phase-on: NEVER
 
             choices:
                 - 'trusty'
                 - 'centos7'
-
+- parameter:
+    name: 'huawei-virtual-defaults'
+    parameters:
+        - label:
+            name: SLAVE_LABEL
+            default: 'huawei-deploy-vm'
+        - string:
+            name: GIT_BASE
+            default: https://gerrit.opnfv.org/gerrit/$PROJECT
+            description: 'Git URL to use on these Jenkins Slaves'
 ########################
 # trigger macros
 ########################
 - trigger:
     name: 'compass-os-odl_l2-nofeature-ha-intel-pod8-trigger'
     triggers:
-        - timed: '0 16 * * *'
+        - timed: ''
 - trigger:
     name: 'compass-os-onos-nofeature-ha-intel-pod8-trigger'
     triggers:
     name: 'compass-os-ocl-nofeature-ha-intel-pod8-trigger'
     triggers:
         - timed: ''
+- trigger:
+    name: 'compass-os-nosdn-nofeature-ha-huawei-virtual-trigger'
+    triggers:
+        - timed: ''
+- trigger:
+    name: 'compass-os-odl_l2-nofeature-ha-huawei-virtual-trigger'
+    triggers:
+        - timed: '0 16 * * *'
+- trigger:
+    name: 'compass-os-onos-nofeature-ha-huawei-virtual-trigger'
+    triggers:
+        - timed: '0 16 * * *'
+- trigger:
+    name: 'compass-os-ocl-nofeature-ha-huawei-virtual-trigger'
+    triggers:
+        - timed: ''
diff --git a/jjb/compass4nfv/compass-deploy.sh b/jjb/compass4nfv/compass-deploy.sh
new file mode 100644 (file)
index 0000000..7f22770
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+set -x
+
+# log info to console
+echo "Starting the deployment on baremetal environment using $INSTALLER_TYPE. This could take some time..."
+echo "--------------------------------------------------------"
+echo
+
+export CONFDIR=$WORKSPACE/deploy/conf
+export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
+if [[ "$NODE_NAME" =~ "-vm" ]]; then
+    export NETWORK_CONF=$CONFDIR/vm_environment/$NODE_NAME/network.yml
+    export DHA_CONF=$CONFDIR/vm_environment/${{DEPLOY_SCENARIO}}.yml
+else
+    export INSTALL_NIC=eth0
+    export NETWORK_CONF=$CONFDIR/hardware_environment/$NODE_NAME/network.yml
+    export DHA_CONF=$CONFDIR/hardware_environment/$NODE_NAME/${{DEPLOY_SCENARIO}}.yml
+fi
+
+cd $WORKSPACE
+
+export OS_VERSION=${{COMPASS_OS_VERSION}}
+export OPENSTACK_VERSION=${{COMPASS_OPENSTACK_VERSION}}
+./deploy.sh --dha ${DHA_CONF} --network ${NETWORK_CONF}
+if [ $? -ne 0 ]; then
+    echo "depolyment failed!"
+    deploy_ret=1
+fi
+
+echo
+echo "--------------------------------------------------------"
+echo "Done!"
+
+ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
+sshpass -p root scp 2>/dev/null $ssh_options root@${{INSTALLER_IP}}:/var/ansible/run/openstack_${{COMPASS_OPENSTACK_VERSION}}-opnfv2/ansible.log ./  &> /dev/null
+
+exit $deploy_ret
index 565aaa3..0316e6f 100644 (file)
@@ -33,8 +33,7 @@
         - 'compass-verify-{stream}'
         - 'compass-build-iso-{stream}'
         - 'compass-build-ppa-{stream}'
-        - 'compass-deploy-virtual-{scenario}-{stream}'
-        - 'compass-virtual-daily-{stream}'
+
 
 ########################
 # job templates
             fingerprint: true
 
 - job-template:
-    name: 'compass-virtual-daily-{stream}'
+    name: 'compass-build-iso-{stream}'
 
-    node: huawei-build
+    node: ericsson-build
 
     concurrent: true
 
     triggers:
         - timed: 'H 14 * * *'
 
-    builders:
-        - trigger-builds:
-          - project: 'compass-build-iso-{stream}'
-            git-revision: true
-            block: true
-        - trigger-builds:
-          - project: 'compass-deploy-virtual-os-nosdn-nofeature-ha-{stream}'
-            git-revision: true
-            block: false
-        - trigger-builds:
-          - project: 'compass-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
-            git-revision: true
-            block: false
-        - trigger-builds:
-          - project: 'compass-deploy-virtual-os-onos-nofeature-ha-{stream}'
-            git-revision: true
-            block: false
-
-- job-template:
-    name: 'compass-build-iso-{stream}'
-
-    node: ericsson-build
-
-    concurrent: true
-
-    properties:
-        - throttle:
-            enabled: true
-            max-total: 1
-            max-per-node: 1
-
-    parameters:
-        - project-parameter:
-            project: '{project}'
-        - compass-project-parameter:
-            installer: '{installer}'
-            gs-pathname: '{gs-pathname}'
-        - '{node}-defaults'
-        - '{installer}-defaults'
-
-    scm:
-        - git-scm:
-            credentials-id: '{ssh-credentials}'
-            refspec: ''
-            branch: '{branch}'
-
     builders:
         - shell:
             !include-raw: ./compass-build.sh
         - shell:
             !include-raw: ./compass-makeppa.sh
 
-- job-template:
-    name: 'compass-deploy-virtual-{scenario}-{stream}'
-
-    disabled: false
-
-    node: '{node}'
-
-    concurrent: true
-
-    properties:
-        - throttle:
-            enabled: true
-            max-total: 1
-            max-per-node: 1
-
-    parameters:
-        - project-parameter:
-            project: '{project}'
-        - compass-project-parameter:
-            installer: '{installer}'
-            gs-pathname: '{gs-pathname}'
-        - string:
-            name: DEPLOY_SCENARIO
-            default: '{scenario}'
-        - '{node}-defaults'
-        - '{installer}-defaults'
 
-    builders:
-        - shell:
-            !include-raw: ./compass-workspace-precleanup.sh
-        - shell:
-            !include-raw: ./compass-download-artifact.sh
-        - shell:
-            !include-raw: ./compass-deploy-virtual.sh
-
-    publishers:
-        - archive:
-            artifacts: 'ansible.log'
-            allow-empty: 'true'
-            fingerprint: true
 
 ########################
 # parameter macros