3 sudo chown onap:onap -R /service
4 find /service -name '*.sh'|xargs chmod a+x
6 if [ -z "$SERVICE_IP" ]; then
7 export SERVICE_IP=`hostname -i`
9 echo "SERVICE_IP=$SERVICE_IP"
11 if [ -z "$MSB_ADDR" ]; then
12 echo "Missing required variable MSB_ADDR: Microservices Service Bus address <ip>:<port>"
15 echo "MSB_ADDR=$MSB_ADDR"
17 if [ -z "$MYSQL_ADDR" ]; then
18 echo "Missing required variable MYSQL_ADDR: <ip>:<port>"
21 echo "MYSQL_ADDR=$MYSQL_ADDR"
23 # Wait for MSB initialization
24 echo "Wait for MSB initialization"
26 curl -sS -m 1 $MSB_PROTO://$MSB_ADDR/msb -k > /dev/null
28 if [ $res -ne 0 ]; then
34 # Wait for DB initialization
35 echo "Wait for DB initialization"
37 curl -sS -m 1 $MYSQL_ADDR > /dev/null && break
41 # Configure service based on docker environment variables
42 vfc/nfvo/lcm/docker/instance_config.sh
44 # microservice-specific one-time initialization
45 vfc/nfvo/lcm/docker/instance_init.sh
49 # Start the microservice
50 vfc/nfvo/lcm/docker/instance_run.sh