blob: a7378b75c9af53c2d3f7f0b448a46a1767db256b [file] [log] [blame]
Instrumental97083ef2018-04-25 15:22:38 -05001#!/bin/bash
Instrumental12f7f462018-04-23 15:43:47 -05002# Pull in Variables from d.props
Instrumentalf482ea02018-04-10 15:03:24 -05003. ./d.props
Sai Gandhamce6a67f2018-04-10 14:25:35 +00004
Instrumental9ec28952018-07-12 11:14:10 -05005# Create Volumes, if not exist already
6for VOL in aaf_config aaf_cass_data; do
7 HAS_VOLUME=`docker volume ls | grep $VOL`
8 if [ "$HAS_VOLUME" = "" ]; then
9 docker volume create --name $VOL
10 fi
11done
12 docker run \
13 -d \
14 --name aaf_config \
15 --mount 'type=volume,src=aaf_config,dst=/opt/app/osaaf,volume-driver=local' \
16 ${ORG}/${PROJECT}/aaf_agent:${VERSION}
Instrumental71037c32018-03-26 13:51:48 -070017
18if [ "$1" == "" ]; then
Instrumentalac836d02018-04-06 05:27:41 -050019 AAF_COMPONENTS=`ls -r ../aaf_${VERSION}/bin | grep -v '\.'`
Instrumental71037c32018-03-26 13:51:48 -070020else
21 AAF_COMPONENTS=$1
22fi
23
24for AAF_COMPONENT in ${AAF_COMPONENTS}; do
Instrumental71037c32018-03-26 13:51:48 -070025 case "$AAF_COMPONENT" in
Instrumental679f1422018-04-06 14:59:36 -050026 "service")
27 PORTMAP="8100:8100"
28 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
29 ;;
30 "locate")
31 PORTMAP="8095:8095"
32 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
33 ;;
34 "oauth")
35 PORTMAP="8140:8140"
36 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
37 ;;
38 "gui")
39 PORTMAP="8200:8200"
40 ;;
41 "cm")
42 PORTMAP="8150:8150"
43 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
44 ;;
45 "hello")
46 PORTMAP="8130:8130"
47 ;;
48 "fs")
49 PORTMAP="80:8096"
50 ;;
Instrumental71037c32018-03-26 13:51:48 -070051 esac
52
Instrumentalac836d02018-04-06 05:27:41 -050053 echo Starting aaf_$AAF_COMPONENT...
Instrumental679f1422018-04-06 14:59:36 -050054
Instrumentalac836d02018-04-06 05:27:41 -050055 docker run \
Instrumental1efda072018-04-24 07:08:05 -050056 -d \
Instrumentalac836d02018-04-06 05:27:41 -050057 --name aaf_$AAF_COMPONENT \
Instrumental679f1422018-04-06 14:59:36 -050058 --hostname="${AAF_COMPONENT}.aaf.osaaf.org" \
59 --add-host="$HOSTNAME:$HOST_IP" \
60 --add-host="aaf.osaaf.org:$HOST_IP" \
61 ${LINKS} \
Instrumentalac836d02018-04-06 05:27:41 -050062 --publish $PORTMAP \
63 --mount type=bind,source=$CONF_ROOT_DIR,target=/opt/app/osaaf \
Instrumental9ec28952018-07-12 11:14:10 -050064 ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
Instrumental71037c32018-03-26 13:51:48 -070065done