979462b19edd5fe48c69af5cb52ca680f23aafd0
[releng.git] / jjb / compass4nfv / compass-deploy.sh
1 #!/bin/bash
2 set -x
3
4 # log info to console
5 echo "Starting the deployment on baremetal environment using $INSTALLER_TYPE. This could take some time..."
6 echo "--------------------------------------------------------"
7 echo
8
9 export CONFDIR=$WORKSPACE/deploy/conf
10 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
11 if [[ "$NODE_NAME" =~ "-vm" ]]; then
12     export NETWORK_CONF=$CONFDIR/vm_environment/$NODE_NAME/network.yml
13     export DHA_CONF=$CONFDIR/vm_environment/${{DEPLOY_SCENARIO}}.yml
14 else
15     export INSTALL_NIC=eth0
16     export NETWORK_CONF=$CONFDIR/hardware_environment/$NODE_NAME/network.yml
17     export DHA_CONF=$CONFDIR/hardware_environment/$NODE_NAME/${{DEPLOY_SCENARIO}}.yml
18 fi
19
20 cd $WORKSPACE
21
22 export OS_VERSION=${{COMPASS_OS_VERSION}}
23 export OPENSTACK_VERSION=${{COMPASS_OPENSTACK_VERSION}}
24 ./deploy.sh --dha ${{DHA_CONF}} --network ${{NETWORK_CONF}}
25 if [ $? -ne 0 ]; then
26     echo "depolyment failed!"
27     deploy_ret=1
28 fi
29
30 echo
31 echo "--------------------------------------------------------"
32 echo "Done!"
33
34 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
35 sshpass -p root scp 2>/dev/null $ssh_options root@${{INSTALLER_IP}}:/var/ansible/run/openstack_${{COMPASS_OPENSTACK_VERSION}}-opnfv2/ansible.log ./  &> /dev/null
36
37 exit $deploy_ret