Create Baremetal deployment job of compass in Huawei's us lab 85/2985/2
authorm00133142 <meimei@huawei.com>
Mon, 2 Nov 2015 22:25:22 +0000 (14:25 -0800)
committerm00133142 <meimei@huawei.com>
Tue, 3 Nov 2015 02:08:40 +0000 (18:08 -0800)
JIRA: COMPASS-133

Change-Id: I317f4a2d35fca50fce4715e78f1c9c663649344a
Signed-off-by: m00133142 <meimei@huawei.com>
jjb/compass4nfv/compass4nfv.yml

index 9978fdc..3159cfa 100644 (file)
@@ -12,6 +12,7 @@
         - 'compass-build-iso'
         - 'compass-build-ppa'
         - 'compass-deploy-virtual-{flavor}'
+        - 'compass-deploy-bare-huawei-us'
 
     # stream:    branch with - in place of / (eg. stable-helium)
     # branch:    branch (eg. stable/helium)
             allow-empty: 'true'
             fingerprint: true
 
+
+- job-template:
+    name: 'compass-deploy-bare-huawei-us'
+
+    project-type: freestyle
+
+    disabled: false
+
+    node: 'huawei-us-deploy-bare-1'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - compass-parameter:
+            installer: '{installer}'
+
+    logrotate:
+        daysToKeep: 30
+        numToKeep: 10
+        artifactDaysToKeep: -1
+        artifactNumToKeep: -1
+
+    builders:
+        - 'builder-compass-ci-preclean-workspace'
+        - 'builder-compass-download-artifact'
+        - 'builder-compass-deploy-bare'
+
+    publishers:
+        - archive:
+            artifacts: 'ansible.log'
+            allow-empty: 'true'
+            fingerprint: true
+
+
 ########################
 # parameter macros
 ########################
 
             exit $deploy_ret
 
+- builder:
+    name: 'builder-compass-deploy-bare'
+    builders:
+        - shell: |
+            #!/bin/bash
+            set -x
+
+            # log info to console
+            echo "Starting the deployment on baremetal environment using $INSTALLER. This could take some time..."
+            echo "--------------------------------------------------------"
+            echo
+
+            export CONFDIR=$WORKSPACE/deploy/conf/hardware_environment/huawei_us_lab/pod1
+            export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
+            cd $WORKSPACE
+
+            ./deploy.sh --dha $CONFDIR/dha.yml --network $CONFDIR/network.yml
+            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_juno-opnfv2/ansible.log ./  &> /dev/null
+
+            exit $deploy_ret
 
 - builder:
     name: 'builder-compass-upload-artifact'