Merge "JOID-46 Add script to create the external network and update the gw_mac for...
[joid.git] / ci / 01-deploybundle.sh
1 #!/bin/bash
2 #placeholder for deployment script.
3 set -ex
4
5 case "$1" in
6     'nonha' )
7         cp $4/juju-deployer/ovs-$4-nonha.yaml ./bundles.yaml
8         ;;
9     'ha' )
10         cp $4/juju-deployer/ovs-$4-ha.yaml ./bundles.yaml
11         ;;
12     'tip' )
13         cp $4/juju-deployer/ovs-$4-tip.yaml ./bundles.yaml
14         cp common/source/* ./
15         sed -i -- "s|branch: master|branch: stable/$2|g" ./*.yaml
16         ;;
17     * )
18         cp $4/juju-deployer/ovs-$4-nonha.yaml ./bundles.yaml
19         ;;
20 esac
21
22 case "$3" in
23     'orangepod2' )
24         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
25          sed -i -- 's/10.4.1.1/192.168.2.2/g' ./bundles.yaml
26         # choose the correct interface to use for data network
27          sed -i -- 's/#os-data-network: 10.4.8.0\/21/os-data-network: 192.168.12.0\/24/g' ./bundles.yaml
28         # Choose the external port to go out from gateway to use.
29          sed -i -- 's/#        "ext-port": "eth1"/        "ext-port": "eth1"/g' ./bundles.yaml
30          ;;
31      'intelpod6' )
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/10.4.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: 10.4.9.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": "eth2"/g' ./bundles.yaml
38          ;;
39      'intelpod5' )
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": "eth2.724"/g' ./bundles.yaml
46         ;;
47      'attvirpod1' )
48         # As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
49          sed -i -- 's/10.4.1.1/192.168.10.1/g' ./bundles.yaml
50         # Choose the external port to go out from gateway to use.
51          sed -i -- 's/#        "ext-port": "eth1"/        "ext-port": "eth1"/g' ./bundles.yaml
52         ;;
53      'cengnlynxpod1' )
54          sed -i -- 's/10.4.1.1/10.120.0.1/g' ./bundles.yaml
55          sed -i -- 's/#        "ext-port": "eth1"/        "ext-port": "eth2.1202"/g' ./bundles.yaml
56         ;;
57      'default' )
58          sed -i -- 's/10.4.1.1/192.168.122.1/g' ./bundles.yaml
59          sed -i -- 's/#        "ext-port": "eth1"/        "ext-port": "eth1"/g' ./bundles.yaml
60         ;;
61 esac
62
63 case "$5" in
64     'ipv6' )
65          sed -i -- 's/#prefer-ipv6: true/prefer-ipv6: true/g' ./bundles.yaml
66         ;;
67 esac
68
69 echo "... Deployment Started ...."
70 case "$1" in
71     'nonha' )
72         juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes
73         juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml trusty-"$2"
74         ;;
75     'ha' )
76         juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes
77         juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml trusty-"$2"
78         ;;
79     'tip' )
80         juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes
81         juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml trusty-"$2"
82         ;;
83     * )
84         juju-deployer -vW -d -c bundles.yaml trusty-"$2"-nodes
85         juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml trusty-"$2"
86         ;;
87 esac
88
89 case "$4" in
90     'onos' )
91          echo "... onos prepare test ..."
92          sleep 180s
93          sh onos/juju_test_prepare.sh "$3"
94         ;;
95 esac