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=10550
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 curldata='{"serviceName": "workflow", "version": "v1", "url": "/api/workflow/v1","protocol": "REST", "visualRange": "1", "nodes": [ {"ip": "'$SERVICE_IP'","port": "'$SERVICE_PORT'","ttl": 0}]}'
36 curl -v -X POST -H "Accept: Application/json" -H "Content-Type: application/json" -d "${curldata}" http://$OPENPALETTE_MSB_IP:$OPENPALETTE_MSB_PORT/api/microservices/v1/services
42 # we can modify files here, using ENV variables passed in
43 # "docker create" command. It can't be done during build process.
47 # Run custom command. Thanks to this line we can still use
48 # "docker run our_image /bin/bash" and it will work