summaryrefslogtreecommitdiffstats
path: root/jjb/compass4nfv/compass-deploy.sh
blob: 2668ccdf829912ff13cbd992de0b7f0e705bd978 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/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

# source the properties file so we get OPNFV vars
source $BUILD_DIRECTORY/latest.properties

# echo the info about artifact that is used during the deployment
echo "Using ${OPNFV_ARTIFACT_URL/*\/} for deployment"

if [[ ! "$JOB_NAME" =~ (verify|merge) ]]; then
    # for none-merge deployments
    # checkout the commit that was used for building the downloaded artifact
    # to make sure the ISO and deployment mechanism uses same versions
    echo "Checking out $OPNFV_GIT_SHA1"
    git checkout $OPNFV_GIT_SHA1 --quiet
fi

echo 1 > /proc/sys/vm/drop_caches

export CONFDIR=$WORKSPACE/deploy/conf
if [[ "$BRANCH" = 'stable/danube' ]]; then
    export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
else
    export ISO_URL=file://$BUILD_DIRECTORY/compass.tar.gz
fi

cd $WORKSPACE

export OS_VERSION=${COMPASS_OS_VERSION}
export OPENSTACK_VERSION=${COMPASS_OPENSTACK_VERSION}

if [[ "${DEPLOY_SCENARIO}" =~ "-ocl" ]]; then
    export NETWORK_CONF_FILE=network_ocl.yml
elif [[ "${DEPLOY_SCENARIO}" =~ "-onos" ]]; then
    export NETWORK_CONF_FILE=network_onos.yml
elif [[ "${DEPLOY_SCENARIO}" =~ "-openo" ]]; then
    export NETWORK_CONF_FILE=network_openo.yml
else
    export NETWORK_CONF_FILE=network.yml
fi

if [[ "$NODE_NAME" =~ "intel-pod8" ]]; then
    export OS_MGMT_NIC=em4
fi

if [[ "$NODE_NAME" =~ "-virtual" ]]; then
    export NETWORK_CONF=$CONFDIR/vm_environment/$NODE_NAME/${NETWORK_CONF_FILE}
    export DHA_CONF=$CONFDIR/vm_environment/${DEPLOY_SCENARIO}.yml
else
    export INSTALL_NIC=eth1
    export NETWORK_CONF=$CONFDIR/hardware_environment/$NODE_NAME/${NETWORK_CONF_FILE}
    export DHA_CONF=$CONFDIR/hardware_environment/$NODE_NAME/${DEPLOY_SCENARIO}.yml
fi

export DHA=${DHA_CONF}
export NETWORK=${NETWORK_CONF}

source ./ci/deploy_ci.sh

if [ $? -ne 0 ]; then
    echo "depolyment failed!"
    deploy_ret=1
fi

echo
echo "--------------------------------------------------------"
echo "Done!"

exit $deploy_ret