blob: 04f5b3238a6076b40c03b0581525596cec0193f3 [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
8 echo "Edit appropriate Cassandra Link Info into cass.props"
9 exit
10fi
11
12. ./cass.props
13
Instrumental71037c32018-03-26 13:51:48 -070014if [ "$1" == "" ]; then
Instrumentale44d2f72018-08-16 17:22:45 -050015 AAF_COMPONENTS=$(cat components)
Instrumental71037c32018-03-26 13:51:48 -070016else
Instrumental4ad47632018-07-13 15:49:26 -050017 AAF_COMPONENTS="$@"
Instrumental71037c32018-03-26 13:51:48 -070018fi
Instrumental679f1422018-04-06 14:59:36 -050019
Instrumental4ad47632018-07-13 15:49:26 -050020for AAF_COMPONENT in ${AAF_COMPONENTS}; do
21 case "$AAF_COMPONENT" in
22 "service")
23 PORTMAP="8100:8100"
24 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
25 ;;
26 "locate")
27 PORTMAP="8095:8095"
28 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
29 ;;
30 "oauth")
31 PORTMAP="8140:8140"
32 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
33 ;;
34 "gui")
35 PORTMAP="8200:8200"
36 ;;
37 "cm")
38 PORTMAP="8150:8150"
39 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
40 ;;
41 "hello")
42 PORTMAP="8130:8130"
43 ;;
44 "fs")
45 PORTMAP="80:8096"
46 ;;
47 esac
48
49 echo Starting aaf_$AAF_COMPONENT...
50
51 docker run \
52 -d \
53 --name aaf_$AAF_COMPONENT \
54 --hostname="${AAF_COMPONENT}.aaf.osaaf.org" \
55 --add-host="$HOSTNAME:$HOST_IP" \
56 --add-host="aaf.osaaf.org:$HOST_IP" \
57 ${LINKS} \
58 --publish $PORTMAP \
59 --mount 'type=volume,src=aaf_config,dst='$CONF_ROOT_DIR',volume-driver=local' \
Instrumentale44d2f72018-08-16 17:22:45 -050060 ${PREFIX}${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
Instrumental71037c32018-03-26 13:51:48 -070061done