Merge "cleanup and also fetch the charms first then deploy."
[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 case "$3" in
28     'orangepod1' )
29         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
30          sed -i -- 's/10.4.1.1/192.168.1.2/g' ./bundles.yaml
31         # choose the correct interface to use for data network
32          sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 192.168.11.0\/24/g' ./bundles.yaml
33         # Choose the external port to go out from gateway to use.
34          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
35         # Use host for public API for Orange pod2
36         # sed -i -- 's/#os-public-hostname: api.public-fqdn/os-public-hostname: api.pod2.opnfv.fr/g' ./bundles.yaml
37          ;;
38     'orangepod2' )
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/192.168.2.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: 192.168.12.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: "eth1"/g' ./bundles.yaml
45         # Use host for public API for Orange pod2
46         # sed -i -- 's/#os-public-hostname: api.public-fqdn/os-public-hostname: api.pod2.opnfv.fr/g' ./bundles.yaml
47          ;;
48      'intelpod6' )
49         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
50          sed -i -- 's/10.4.1.1/10.6.1.2/g' ./bundles.yaml
51         # choose the correct interface to use for data network
52          sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 10.6.12.0\/24/g' ./bundles.yaml
53         # Choose the external port to go out from gateway to use.
54          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth5"/g' ./bundles.yaml
55         # Provide the gateway MAC to route the traffic externally.
56          sed -i -- 's/#gateway-mac: "default"/gateway-mac: "default"/g' ./bundles.yaml
57          ;;
58      'intelpod5' )
59         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
60          sed -i -- 's/10.4.1.1/10.5.1.2/g' ./bundles.yaml
61         # choose the correct interface to use for data network
62          sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 10.5.12.0\/24/g' ./bundles.yaml
63         # Choose the external port to go out from gateway to use.
64          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth5"/g' ./bundles.yaml
65         # Provide the gateway MAC to route the traffic externally.
66          sed -i -- 's/#gateway-mac: "default"/gateway-mac: "default"/g' ./bundles.yaml
67         ;;
68      'attvirpod1' )
69         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
70          sed -i -- 's/10.4.1.1/192.168.10.1/g' ./bundles.yaml
71         # Choose the external port to go out from gateway to use.
72          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
73         ;;
74      'cengnlynxpod1' )
75         # Chose the hard drive(s) to use for CEPH OSD
76          sed -i -- 's|osd-devices: /srv|osd-devices: /dev/sdb|g' ./bundles.yaml
77         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
78          sed -i -- 's/10.4.1.1/10.120.0.1/g' ./bundles.yaml
79         # choose the correct interface to use for data network
80          sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 172.16.121.0\/24/g' ./bundles.yaml
81         # Choose the external port to go out from gateway to use.
82          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1.1202"/g' ./bundles.yaml
83         ;;
84      'juniperpod1' )
85          sed -i -- 's/10.4.1.1/172.16.50.1/g' ./bundles.yaml
86          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
87          ;;
88      'ravellodemopod' )
89          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth2"/g' ./bundles.yaml
90         ;;
91      'custom' )
92          sed -i -- 's/10.4.1.1/192.168.122.1/g' ./bundles.yaml
93          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
94         ;;
95      'default' )
96          sed -i -- 's/10.4.1.1/192.168.122.1/g' ./bundles.yaml
97          sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
98         ;;
99 esac
100
101 case "$5" in
102     'ipv6' )
103          sed -i -- 's/#prefer-ipv6: true/prefer-ipv6: true/g' ./bundles.yaml
104         ;;
105     'dvr' )
106          sed -i -- 's/#enable-dvr: true/enable-dvr: true/g' ./bundles.yaml
107          sed -i -- 's/#l2-population: true/l2-population: true/g' ./bundles.yaml
108         ;;
109     'sfc' )
110          sed -i -- 's/profile: "openvswitch-odl-Be"/profile: "openvswitch-odl-beryllium-sfc"/g' ./bundles.yaml
111         ;;
112     'vpn' )
113          sed -i -- 's/profile: "openvswitch-odl-Be"/profile: "openvswitch-odl-beryllium-vpn"/g' ./bundles.yaml
114         ;;
115     'odl_l3' )
116          sed -i -- 's/profile: "openvswitch-odl-Be"/profile: "openvswitch-odl-beryllium-l3"/g' ./bundles.yaml
117         ;;
118 esac
119
120 echo "... Deployment Started ...."
121 case "$1" in
122     'nonha' )
123         juju-deployer -vW -d -t 3600 -c bundles.yaml trusty-"$2"-nodes
124         juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml trusty-"$2"
125         ;;
126     'ha' )
127         juju-deployer -vW -d -t 3600 -c bundles.yaml trusty-"$2"-nodes
128         juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml trusty-"$2"
129         ;;
130     'tip' )
131         juju-deployer -vW -d -t 3600 -c bundles.yaml trusty-"$2"-nodes
132         juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml trusty-"$2"
133         ;;
134     * )
135         juju-deployer -vW -d -t 3600 -c bundles.yaml trusty-"$2"-nodes
136         juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml trusty-"$2"
137         ;;
138 esac
139
140 #case "$4" in
141 #    'onos' )
142 #         echo "... onos prepare test ..."
143 #         sleep 180s
144 #         sh onos/juju_test_prepare.sh "$3"
145 #        ;;
146 #esac