3 # $1, $2, $3 etc are passed arguments
7 if [ -z "$SERVICE_IP" ]; then
8 export SERVICE_IP=`hostname -i`
10 echo "SERVICE_IP=$SERVICE_IP"
12 if [ -z "$SERVICE_PORT" ]; then
13 export SERVICE_PORT=8080
15 echo "SERVICE_PORT=$SERVICE_PORT"
17 if [ -z "$OPENPALETTE_MSB_IP" ]; then
18 echo "Missing required variable OPENPALETTE_MSB_IP: Microservices Service Bus address <ip>:<port>"
21 if [ -z "$OPENPALETTE_MSB_PORT" ]; then
22 echo "Missing required variable OPENPALETTE_MSB_PORT: Microservices Service Bus address <ip>:<port>"
25 echo "MSB_ADDR=${OPENPALETTE_MSB_IP}:${OPENPALETTE_MSB_PORT}"
27 # Wait for MSB initialization
28 echo "Wait for MSB initialization"
30 curl -sS -m 1 ${OPENPALETTE_MSB_IP}:${OPENPALETTE_MSB_PORT} > /dev/null && break
34 curl -X POST --data '{"serviceName": "activiti-rest","version": "v1","url": "/activiti-rest/","path": "/activiti-rest/","protocol": "REST","visualRange": "1","nodes": [{"ip": "${SERVICE_IP}","port": "${SERVICE_PORT}","ttl": 0}]}' http://${OPENPALETTE_MSB_IP}:${OPENPALETTE_MSB_PORT}/api/microservices/v1/services -H "Accept: Application/json" -H "Content-Type:application/json"
40 # we can modify files here, using ENV variables passed in
41 # "docker create" command. It can't be done during build process.
42 exec ./catalina.sh run
45 # Run custom command. Thanks to this line we can still use
46 # "docker run our_image /bin/bash" and it will work