Refactor ONAP HEAT template config, part 3
[demo.git] / heat / ONAP / cloud-config / aai_install.sh
1 #!/bin/bash
2
3 # Read configuration files
4 GERRIT_BRANCH=$(cat /opt/config/gerrit_branch.txt)
5 AAI_INSTANCE=$(cat /opt/config/aai_instance.txt)
6 CODE_REPO=$(cat /opt/config/remote_repo.txt)
7 HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
8 HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
9
10 if [ $HTTP_PROXY != "no_proxy" ]
11 then
12     export http_proxy=$HTTP_PROXY
13     export https_proxy=$HTTPS_PROXY
14 fi
15
16 # Run docker containers
17 cd /opt
18 git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO
19
20 if [[ $AAI_INSTANCE == "aai_instance_1" ]]
21 then
22         mkdir -p /opt/aai/logroot/AAI-RESOURCES
23         mkdir -p /opt/aai/logroot/AAI-TRAVERSAL
24         mkdir -p /opt/aai/logroot/AAI-ML
25         mkdir -p /opt/aai/logroot/AAI-SDB
26         mkdir -p /opt/aai/logroot/AAI-DRMS
27         mkdir -p /opt/aai/logroot/AAI-UI
28         chown -R 999:999 /opt/aai/logroot/AAI-RESOURCES /opt/aai/logroot/AAI-TRAVERSAL
29
30         sleep 300
31 fi
32
33 ./aai_vm_init.sh