Update project maturity status
[multicloud/azure.git] / azure / docker / docker-entrypoint.sh
1 #!/bin/sh
2 # Copyright (c) 2018 Amdocs
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #         http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16
17 if [ -z "$SERVICE_IP" ]; then
18     export SERVICE_IP=`hostname -i`
19 fi
20 echo
21 echo Environment Variables:
22 echo "SERVICE_IP=$SERVICE_IP"
23
24 if [ -z "$MSB_ADDR" ]; then
25     echo "Missing required variable MSB_ADDR: Microservices Service Bus address <ip>:<port>"
26     exit 1
27 fi
28 echo "MSB_ADDR=$MSB_ADDR"
29 echo
30
31
32 echo
33
34 # Configure service based on docker environment variables
35 multicloud_azure/docker/instance-config.sh
36
37
38 # Perform one-time config
39 if [ ! -e init.log ]; then
40
41     # microservice-specific one-time initialization
42     multicloud_azure/docker/instance-init.sh
43
44     date > init.log
45 fi
46
47 # Start the microservice
48 multicloud_azure/docker/instance-run.sh