modified to fix the typo error.
[joid.git] / ci / odl / 01-deploybundle.sh
1 #!/bin/bash
2 #placeholder for deployment script.
3 set -ex
4
5 case "$1" in
6     'nonha' )
7         cp odl/juju-deployer/ovs-odl.yaml ./bundles.yaml
8         ;;
9     'ha' )
10         cp odl/juju-deployer/ovs-odl-ha.yaml ./bundles.yaml
11         ;;
12     'tip' )
13         cp odl/juju-deployer/ovs-odl-tip.yaml ./bundles.yaml
14         ;;
15     * )
16         cp odl/juju-deployer/ovs-odl.yaml ./bundles.yaml
17         ;;
18 esac
19
20 case "$3" in
21     'orangepod2' )
22         sed -i -- 's/10.4.1.1/192.168.2.2/g' ./bundles.yaml
23         ;;
24     'intelpod6' )
25         sed -i -- 's/10.4.1.1/10.4.1.2/g' ./bundles.yaml
26         sed -i -- 's/#os-data-network/os-data-network/g' ./bundles.yaml
27         ;;
28     'intelpod5' )
29         sed -i -- 's/10.4.1.1/10.4.1.2/g' ./bundles.yaml
30         sed -i -- 's/#os-data-network/os-data-network/g' ./bundles.yaml
31         ;;
32 esac
33
34 echo "... Deployment Started ...."
35 case "$1" in
36     'ha' )
37         juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes
38         case "$3" in
39             'orangepod2' )
40                 juju run --service nodes-api 'sudo ifup eth3'
41                 juju run --service nodes-compute 'sudo ifup eth5'
42             ;;
43             'intelpod6' )
44                 juju run --service nodes-api 'sudo ifup eth1'
45                 juju run --service nodes-compute 'sudo ifup eth1'
46             ;;
47             'intelpod5' )
48                 juju run --service nodes-api 'sudo ifup eth1'
49                 juju run --service nodes-compute 'sudo ifup eth1'
50             ;;
51         esac
52         ;;
53 esac
54
55 juju-deployer -vW -d -c bundles.yaml trusty-"$2"
56
57 echo "... Deployment finished ...."