dd2e49ba5fff4e90dc4de0dcfd4e4488ac4ffbab
[joid.git] / ci / opencontrail / 01-deploybundle.sh
1 #!/bin/bash
2 #placeholder for deployment script.
3 set -ex
4
5 case "$1" in
6     'nonha' )
7         cp opencontrail/juju-deployer/contrail.yaml ./bundles.yaml
8         ;;
9     'ha' )
10         cp opencontrail/juju-deployer/contrail-ha.yaml ./bundles.yaml
11         ;;
12     'tip' )
13         cp opencontrail/juju-deployer/contrail-tip.yaml ./bundles.yaml
14         cp common/source/* ./
15         sed -i -- "s|branch: master|branch: stable/$2|g" ./*.yaml
16         ;;
17     * )
18         cp opencontrail/juju-deployer/contrail.yaml ./bundles.yaml
19         ;;
20 esac
21
22 case "$3" in
23     'orangepod2' )
24         cp maas/orange/pod2/control-interfaces.host trusty/ubuntu-nodes-controller/network/interfaces.host
25         cp maas/orange/pod2/lxc-add-more-interfaces trusty/ubuntu-nodes-controller/lxc/add-more-interfaces
26         cp maas/orange/pod2/compute-interfaces.host trusty/ubuntu-nodes-compute/network/interfaces.host
27         cp maas/orange/pod2/lxc-add-more-interfaces trusty/ubuntu-nodes-compute/lxc/add-more-interfaces
28         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
29          sed -i -- 's/10.4.1.1/192.168.2.2/g' ./bundles.yaml
30         # choose the correct interface to use for data network
31          sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 192.168.12.0\/24/g' ./bundles.yaml
32         # Choose the external port to go out from gateway to use.
33          sed -i -- 's/#        "ext-port": "eth1"/        "ext-port": "eth1"/g' ./bundles.yaml
34          ;;
35      'intelpod6' )
36         # As environment does not need special treatment for interfaces for MAAS 1.9
37          sed -i -- 's/local:trusty\/ubuntu-nodes-controller/cs:trusty\/ubuntu/g' ./bundles.yaml
38          sed -i -- 's/local:trusty\/ubuntu-nodes-compute/cs:trusty\/ubuntu/g' ./bundles.yaml
39         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
40          sed -i -- 's/10.4.1.1/10.4.1.2/g' ./bundles.yaml
41         # choose the correct interface to use for data network
42          sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 10.4.9.0\/24/g' ./bundles.yaml
43         # Choose the external port to go out from gateway to use.
44          sed -i -- 's/#        "ext-port": "eth1"/        "ext-port": "eth2"/g' ./bundles.yaml
45          ;;
46      'intelpod5' )
47         # As environment does not need special treatment for interfaces for MAAS 1.9
48          sed -i -- 's/local:trusty\/ubuntu-nodes-controller/cs:trusty\/ubuntu/g' ./bundles.yaml
49          sed -i -- 's/local:trusty\/ubuntu-nodes-compute/cs:trusty\/ubuntu/g' ./bundles.yaml
50         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
51          sed -i -- 's/10.4.1.1/10.4.1.2/g' ./bundles.yaml
52         # choose the correct interface to use for data network
53          sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 10.4.9.0\/24/g' ./bundles.yaml
54         # Choose the external port to go out from gateway to use.
55          sed -i -- 's/#        "ext-port": "eth1"/        "ext-port": "eth2.724"/g' ./bundles.yaml
56         ;;
57      'attvirpod1' )
58         # As virtual environment does not need special treatment for interfaces.
59          sed -i -- 's/local:trusty\/ubuntu-nodes-controller/cs:trusty\/ubuntu/g' ./bundles.yaml
60          sed -i -- 's/local:trusty\/ubuntu-nodes-compute/cs:trusty\/ubuntu/g' ./bundles.yaml
61         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
62          sed -i -- 's/10.4.1.1/192.168.10.1/g' ./bundles.yaml
63         # Choose the external port to go out from gateway to use.
64          sed -i -- 's/#        "ext-port": "eth1"/        "ext-port": "eth1"/g' ./bundles.yaml
65         ;;
66      'default' )
67          sed -i -- 's/local:trusty\/ubuntu-nodes-controller/cs:trusty\/ubuntu/g' ./bundles.yaml
68          sed -i -- 's/local:trusty\/ubuntu-nodes-compute/cs:trusty\/ubuntu/g' ./bundles.yaml
69          sed -i -- 's/10.4.1.1/192.168.122.1/g' ./bundles.yaml
70          sed -i -- 's/#        "ext-port": "eth1"/        "ext-port": "eth1"/g' ./bundles.yaml
71         ;;
72
73 esac
74
75 echo "... Deployment Started ...."
76 case "$1" in
77     'nonha' )
78         juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes
79         juju-deployer -vW -d -t 7200 -c bundles.yaml trusty-"$2"
80         ;;
81     'ha' )
82         juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes
83         juju-deployer -vW -d -t 7200 -c bundles.yaml trusty-"$2"
84         ;;
85     'tip' )
86         juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes
87         juju-deployer -vW -d -t 7200 -c bundles.yaml trusty-"$2"
88         ;;
89     * )
90         juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes
91         juju-deployer -vW -d -t 7200 -c bundles.yaml trusty-"$2"
92         ;;
93 esac
94