Removed fuel from Genesis master since fuel has moved to repo fuel.
[genesis.git] / compass / ci / launch.sh
1 #set -x
2 WORK_DIR=$COMPASS_DIR/ci/work
3
4 if [[ $# -ge 1 ]];then
5     CONF_NAME=$1
6 else
7     CONF_NAME=cluster
8 fi
9
10 source ${COMPASS_DIR}/ci/log.sh
11 source ${COMPASS_DIR}/deploy/conf/${CONF_NAME}.conf
12 source ${COMPASS_DIR}/deploy/prepare.sh
13 source ${COMPASS_DIR}/deploy/network.sh
14
15 if [[ ! -z $VIRT_NUMBER ]];then
16     source ${COMPASS_DIR}/deploy/host_vm.sh
17 else
18     source ${COMPASS_DIR}/deploy/host_baremetal.sh
19 fi
20
21 source ${COMPASS_DIR}/deploy/compass_vm.sh
22 source ${COMPASS_DIR}/deploy/deploy_host.sh
23
24 ######################### main process
25
26 if ! prepare_env;then
27     echo "prepare_env failed"
28     exit 1
29 fi
30
31 log_info "########## get host mac begin #############"
32 machines=`get_host_macs`
33 if [[ -z $machines ]];then
34     log_error "get_host_macs failed"
35     exit 1
36 fi
37
38 log_info "deploy host macs: $machines"
39 export machines
40
41 log_info "########## set up network begin #############"
42 if ! create_nets;then
43     log_error "create_nets failed"
44     exit 1
45 fi
46
47 if ! launch_compass;then
48     log_error "launch_compass failed"
49     exit 1
50 fi
51 if [[ ! -z $VIRT_NUMBER ]];then
52     if ! launch_host_vms;then
53         log_error "launch_host_vms failed"
54         exit 1
55     fi
56 fi
57 if ! deploy_host;then
58     #tear_down_machines
59     #tear_down_compass
60     exit 1
61 else
62     #tear_down_machines
63     #tear_down_compass
64     exit 0
65 fi