forked from jhershberg/netvirt-ha-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·44 lines (38 loc) · 1.26 KB
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
set -x
path=$1
if [ "$path" = "" ]
then
echo Usage: ./build \<path to netvirt\>
exit 2
fi
targetpath=${path}/karaf/target
feature="odl-netvirt-openstack"
if [[ $1 = *"hwvtepsouthbound"* ]];
then
targetpath="$1/hwvtepsouthbound-karaf/target"
feature="odl-hwvtepsouthbound-rest"
elif [[ $1 = *"southbound"* ]];
then
targetpath="$1/southbound-karaf/target"
feature="odl-southbound-rest"
elif [[ $1 = *"genius"* ]];
then
feature="odl-genius-rest"
elif [[ $1 = *"neutron"* ]];
then
feature="odl-neutron-service"
fi
wget -O ${targetpath}/assembly/bin/configure_cluster.sh https://raw.githubusercontent.com/opendaylight/integration-distribution/master/karaf/src/main/assembly/bin/configure_cluster.sh
chmod +x ${targetpath}/assembly/bin/configure_cluster.sh
for i in 1 2 3
do
base=./mounts/${i}
sudo mount -t overlay | grep -o "mounts/${i}/assembly" | xargs sudo umount
sudo rm -fr $base
mkdir -p ${base}/assembly
mkdir -p ${base}/workdir
mkdir -p ${base}/upper
sudo mount -t overlay overlay -o lowerdir=${targetpath}/assembly,upperdir=${base}/upper,workdir=${base}/workdir ${base}/assembly
sed -i -e "s/\(featuresBoot =.*\)/\1,${feature}/" ${base}/assembly/etc/org.apache.karaf.features.cfg
done
sudo docker build . -t odl