improve: discard venv support for official product
[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 echo 1 > /proc/sys/vm/drop_caches
10
11 export CONFDIR=$WORKSPACE/deploy/conf
12 if [[ "$BRANCH" = 'stable/danube' ]]; then
13     # source the properties file so we get OPNFV vars
14     source $BUILD_DIRECTORY/latest.properties
15     # echo the info about artifact that is used during the deployment
16     echo "Using ${OPNFV_ARTIFACT_URL/*\/} for deployment"
17
18     if [[ ! "$JOB_NAME" =~ (verify|merge) ]]; then
19         # for none-merge deployments
20         # checkout the commit that was used for building the downloaded artifact
21         # to make sure the ISO and deployment mechanism uses same versions
22         echo "Checking out $OPNFV_GIT_SHA1"
23         git checkout $OPNFV_GIT_SHA1 --quiet
24     fi
25
26     export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
27 else
28     export ISO_URL=file://$BUILD_DIRECTORY/compass.tar.gz
29 fi
30
31 cd $WORKSPACE
32
33 export OS_VERSION=${COMPASS_OS_VERSION}
34 export OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION}
35
36 if [[ "${DEPLOY_SCENARIO}" =~ "-ocl" ]]; then
37     export NETWORK_CONF_FILE=network_ocl.yml
38 elif [[ "${DEPLOY_SCENARIO}" =~ "-onos" ]]; then
39     export NETWORK_CONF_FILE=network_onos.yml
40 elif [[ "${DEPLOY_SCENARIO}" =~ "-openo" ]]; then
41     export NETWORK_CONF_FILE=network_openo.yml
42 elif [[ "${DEPLOY_SCENARIO}" =~ "-dpdk" ]]; then
43     export NETWORK_CONF_FILE=network_dpdk.yml
44 else
45     export NETWORK_CONF_FILE=network.yml
46 fi
47
48 if [[ "$NODE_NAME" =~ "intel-pod8" ]]; then
49     export OS_MGMT_NIC=em4
50 fi
51
52 if [[ "$NODE_NAME" =~ "-virtual" ]]; then
53     export NETWORK_CONF=$CONFDIR/vm_environment/$NODE_NAME/${NETWORK_CONF_FILE}
54     export DHA_CONF=$CONFDIR/vm_environment/${DEPLOY_SCENARIO}.yml
55     if [[ "${DEPLOY_SCENARIO}" =~ "-moon-noha" ]]; then
56         export VIRT_NUMBER=3
57     elif [[ "${DEPLOY_SCENARIO}" =~ "-noha" ]]; then
58         export VIRT_NUMBER=2
59     fi
60 else
61     export INSTALL_NIC=eth1
62     export NETWORK_CONF=$CONFDIR/hardware_environment/$NODE_NAME/${NETWORK_CONF_FILE}
63     export DHA_CONF=$CONFDIR/hardware_environment/$NODE_NAME/${DEPLOY_SCENARIO}.yml
64 fi
65
66 export DHA=${DHA_CONF}
67 export NETWORK=${NETWORK_CONF}
68
69 source ./ci/deploy_ci.sh
70
71 if [ $? -ne 0 ]; then
72     echo "depolyment failed!"
73     deploy_ret=1
74 fi
75
76 echo
77 echo "--------------------------------------------------------"
78 echo "Done!"
79
80 exit $deploy_ret