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