Add Dockerfile of vfc-gvnfm-vnflcm
[vfc/gvnfm/vnflcm.git] / lcm / docker / instance_init.sh
1 #!/bin/bash
2 function install_python_libs {
3     cd /service/vfc/gvnfm/vnflcm/lcm
4     pip install -r requirements.txt
5 }
6
7 function start_redis_server {
8     redis-server &
9 }
10
11 function start_mysql {
12     service mysql start
13 }
14
15 function create_database {
16     cd /service/bin
17     bash initDB.sh root $MYSQL_ROOT_PASSWORD 3306 127.0.0.1
18 }
19
20 function edit_configs {
21     cd /service/vfc/gvnfm/vnflcm/lcm/docker
22     bash instance_config.sh
23 }
24
25 function start_server {
26     cd /service/vfc/gvnfm/vnflcm/lcm
27     bash run.sh
28 }
29
30 if [ $MYSQL_ROOT_PASSWORD ]; then
31     install_python_libs
32     start_redis_server
33     start_mysql
34     create_database
35     edit_configs
36     start_server
37 else
38     echo "MYSQL_ROOT_PASSWORD environment variable not set."
39 fi