18995249044a7c11d1fd537d9c04573160c45f40
[demo.git] / heat / ONAP / cloud-config / so_install.sh
1 #!/bin/bash
2
3 # Read configuration files
4 OPENSTACK_API_KEY=$(cat /opt/config/openstack_api_key.txt)
5 GERRIT_BRANCH=$(cat /opt/config/gerrit_branch.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
17 # Download scripts from Nexus
18 update-rc.d so_serv.sh defaults
19
20
21 # Clone Gerrit repository and run docker containers.
22 cd /opt
23 git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO test_lab
24 SO_ENCRYPTION_KEY=$(cat /opt/test_lab/encryption.key)
25 echo -n "$OPENSTACK_API_KEY" | openssl aes-128-ecb -e -K $SO_ENCRYPTION_KEY -nosalt | xxd -c 256 -p > /opt/config/api_key.txt
26
27 ./so_vm_init.sh