remove the extra entries and now changing it during run time.
[joid.git] / ci / 01-deploybundle.sh
1 #!/bin/bash
2 #placeholder for deployment script.
3 set -ex
4
5 #copy and download charms
6     cp $4/fetch-charms.sh ./fetch-charms.sh
7     sh ./fetch-charms.sh
8
9
10 case "$1" in
11     'nonha' )
12         cp $4/juju-deployer/ovs-$4-nonha.yaml ./bundles.yaml
13         ;;
14     'ha' )
15         cp $4/juju-deployer/ovs-$4-ha.yaml ./bundles.yaml
16         ;;
17     'tip' )
18         cp $4/juju-deployer/ovs-$4-tip.yaml ./bundles.yaml
19         cp common/source/* ./
20         sed -i -- "s|branch: master|branch: stable/$2|g" ./*.yaml
21         ;;
22     * )
23         cp $4/juju-deployer/ovs-$4-nonha.yaml ./bundles.yaml
24         ;;
25 esac
26
27 #changing the target to the openstack release we want to deploy. 
28 sed -i -- "s|mitaka|$2|g" ./bundles.yaml
29
30 case "$3" in
31     'orangepod1' )
32         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
33          sed -i -- 's/10.4.1.1/192.168.1.2/g' ./bundles.yaml
34         # choose the correct interface to use for data network
35          sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 192.168.11.0\/24/g' ./bundles.yaml
36         # Choose the external port to go out from gateway to use.
37          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
38         # Use host for public API for Orange pod2
39         # sed -i -- 's/#os-public-hostname: api.public-fqdn/os-public-hostname: api.pod2.opnfv.fr/g' ./bundles.yaml
40          ;;
41     'orangepod2' )
42         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
43          sed -i -- 's/10.4.1.1/192.168.2.2/g' ./bundles.yaml
44         # choose the correct interface to use for data network
45          sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 192.168.12.0\/24/g' ./bundles.yaml
46         # Choose the external port to go out from gateway to use.
47          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
48         # Use host for public API for Orange pod2
49         # sed -i -- 's/#os-public-hostname: api.public-fqdn/os-public-hostname: api.pod2.opnfv.fr/g' ./bundles.yaml
50          ;;
51      'intelpod6' )
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.6.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.6.12.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: "eth5"/g' ./bundles.yaml
58         # Provide the gateway MAC to route the traffic externally.
59          sed -i -- 's/#gateway-mac: "default"/gateway-mac: "default"/g' ./bundles.yaml
60          ;;
61      'intelpod5' )
62         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
63          sed -i -- 's/10.4.1.1/10.5.1.2/g' ./bundles.yaml
64         # choose the correct interface to use for data network
65          sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 10.5.12.0\/24/g' ./bundles.yaml
66         # Choose the external port to go out from gateway to use.
67          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth5"/g' ./bundles.yaml
68         # Provide the gateway MAC to route the traffic externally.
69          sed -i -- 's/#gateway-mac: "default"/gateway-mac: "default"/g' ./bundles.yaml
70         ;;
71      'attvirpod1' )
72         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
73          sed -i -- 's/10.4.1.1/192.168.10.1/g' ./bundles.yaml
74         # Choose the external port to go out from gateway to use.
75          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
76         ;;
77      'cengnlynxpod1' )
78         # Chose the hard drive(s) to use for CEPH OSD
79          sed -i -- 's|osd-devices: /srv|osd-devices: /dev/sdb|g' ./bundles.yaml
80         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
81          sed -i -- 's/10.4.1.1/10.120.0.1/g' ./bundles.yaml
82         # choose the correct interface to use for data network
83          sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 172.16.121.0\/24/g' ./bundles.yaml
84         # Choose the external port to go out from gateway to use.
85          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1.1202"/g' ./bundles.yaml
86         ;;
87      'juniperpod1' )
88          sed -i -- 's/10.4.1.1/172.16.50.1/g' ./bundles.yaml
89          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
90          ;;
91      'ravellodemopod' )
92          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth2"/g' ./bundles.yaml
93         ;;
94      'custom' )
95          sed -i -- 's/10.4.1.1/192.168.122.1/g' ./bundles.yaml
96          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
97         ;;
98      'default' )
99          sed -i -- 's/10.4.1.1/192.168.122.1/g' ./bundles.yaml
100          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
101         ;;
102 esac
103
104 case "$5" in
105     'ipv6' )
106          sed -i -- 's/#prefer-ipv6: true/prefer-ipv6: true/g' ./bundles.yaml
107         ;;
108     'dvr' )
109          sed -i -- 's/#enable-dvr: true/enable-dvr: true/g' ./bundles.yaml
110          sed -i -- 's/#l2-population: true/l2-population: true/g' ./bundles.yaml
111         ;;
112     'sfc' )
113          sed -i -- 's/profile: "openvswitch-odl-Be"/profile: "openvswitch-odl-beryllium-sfc"/g' ./bundles.yaml
114         ;;
115     'vpn' )
116          sed -i -- 's/profile: "openvswitch-odl-Be"/profile: "openvswitch-odl-beryllium-vpn"/g' ./bundles.yaml
117         ;;
118     'odl_l3' )
119          sed -i -- 's/profile: "openvswitch-odl-Be"/profile: "openvswitch-odl-beryllium-l3"/g' ./bundles.yaml
120         ;;
121 esac
122
123 echo "... Deployment Started ...."
124 case "$1" in
125     'nonha' )
126         juju-deployer -vW -d -t 3600 -c bundles.yaml trusty-"$2"-nodes
127         juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml trusty-"$2"
128         ;;
129     'ha' )
130         juju-deployer -vW -d -t 3600 -c bundles.yaml trusty-"$2"-nodes
131         juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml trusty-"$2"
132         ;;
133     'tip' )
134         juju-deployer -vW -d -t 3600 -c bundles.yaml trusty-"$2"-nodes
135         juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml trusty-"$2"
136         ;;
137     * )
138         juju-deployer -vW -d -t 3600 -c bundles.yaml trusty-"$2"-nodes
139         juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml trusty-"$2"
140         ;;
141 esac
142
143 #case "$4" in
144 #    'onos' )
145 #         echo "... onos prepare test ..."
146 #         sleep 180s
147 #         sh onos/juju_test_prepare.sh "$3"
148 #        ;;
149 #esac