blob: 2eb025eab0b35fe41965c96a5df61e948c4f6943 [file] [log] [blame]
Instrumental4ad47632018-07-13 15:49:26 -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
Instrumental567a9632018-08-14 13:55:32 -05005# Only need Cassandra Link Info when initializing the container.
6if [ ! -e ./cass.props ]; then
7 cp cass.props.init cass.props
Instrumentala05704f2018-09-17 13:58:02 -05008fi
9
10CASS_IS_SET="$(grep '<Cass IP>' cass.props)"
11if [ -n "$CASS_IS_SET" ]; then
12 CASS_IP="$(docker container inspect aaf_cass | grep \"IPAddress\": -m 1 | cut -d '"' -f 4)"
13 if [ -n "$CASS_IP" ]; then
14 sed -i -e "s/\(^.*:\).*/\1$CASS_IP/" cass.props
15 else
16 echo "Set CASSASNDRA IP in cass.props"
17 exit
18 fi
Instrumental567a9632018-08-14 13:55:32 -050019fi
20
21. ./cass.props
22
Instrumental71037c32018-03-26 13:51:48 -070023if [ "$1" == "" ]; then
Instrumentale44d2f72018-08-16 17:22:45 -050024 AAF_COMPONENTS=$(cat components)
Instrumental71037c32018-03-26 13:51:48 -070025else
Instrumental4ad47632018-07-13 15:49:26 -050026 AAF_COMPONENTS="$@"
Instrumental71037c32018-03-26 13:51:48 -070027fi
Instrumental679f1422018-04-06 14:59:36 -050028
Instrumental4ad47632018-07-13 15:49:26 -050029for AAF_COMPONENT in ${AAF_COMPONENTS}; do
30 case "$AAF_COMPONENT" in
31 "service")
32 PORTMAP="8100:8100"
33 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
34 ;;
35 "locate")
36 PORTMAP="8095:8095"
37 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
38 ;;
39 "oauth")
40 PORTMAP="8140:8140"
41 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
42 ;;
43 "gui")
44 PORTMAP="8200:8200"
45 ;;
46 "cm")
47 PORTMAP="8150:8150"
48 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
49 ;;
50 "hello")
51 PORTMAP="8130:8130"
52 ;;
53 "fs")
54 PORTMAP="80:8096"
55 ;;
56 esac
57
58 echo Starting aaf_$AAF_COMPONENT...
59
60 docker run \
61 -d \
62 --name aaf_$AAF_COMPONENT \
63 --hostname="${AAF_COMPONENT}.aaf.osaaf.org" \
64 --add-host="$HOSTNAME:$HOST_IP" \
65 --add-host="aaf.osaaf.org:$HOST_IP" \
66 ${LINKS} \
67 --publish $PORTMAP \
68 --mount 'type=volume,src=aaf_config,dst='$CONF_ROOT_DIR',volume-driver=local' \
Instrumentale44d2f72018-08-16 17:22:45 -050069 ${PREFIX}${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
Instrumental71037c32018-03-26 13:51:48 -070070done