blob: 350ce3db8084d2f4f5d0995c302288e34d14107a [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
Instrumentalbc299c02018-09-25 06:42:31 -050023bash aaf.sh onap
24
Instrumental71037c32018-03-26 13:51:48 -070025if [ "$1" == "" ]; then
Instrumentale44d2f72018-08-16 17:22:45 -050026 AAF_COMPONENTS=$(cat components)
Instrumental71037c32018-03-26 13:51:48 -070027else
Instrumental4ad47632018-07-13 15:49:26 -050028 AAF_COMPONENTS="$@"
Instrumental71037c32018-03-26 13:51:48 -070029fi
Instrumental679f1422018-04-06 14:59:36 -050030
Instrumental4ad47632018-07-13 15:49:26 -050031for AAF_COMPONENT in ${AAF_COMPONENTS}; do
32 case "$AAF_COMPONENT" in
33 "service")
34 PORTMAP="8100:8100"
35 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
36 ;;
37 "locate")
38 PORTMAP="8095:8095"
39 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
40 ;;
41 "oauth")
42 PORTMAP="8140:8140"
43 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
44 ;;
45 "gui")
46 PORTMAP="8200:8200"
47 ;;
48 "cm")
49 PORTMAP="8150:8150"
50 LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST"
51 ;;
52 "hello")
53 PORTMAP="8130:8130"
54 ;;
55 "fs")
56 PORTMAP="80:8096"
57 ;;
58 esac
59
60 echo Starting aaf_$AAF_COMPONENT...
61
62 docker run \
63 -d \
64 --name aaf_$AAF_COMPONENT \
65 --hostname="${AAF_COMPONENT}.aaf.osaaf.org" \
66 --add-host="$HOSTNAME:$HOST_IP" \
67 --add-host="aaf.osaaf.org:$HOST_IP" \
68 ${LINKS} \
69 --publish $PORTMAP \
70 --mount 'type=volume,src=aaf_config,dst='$CONF_ROOT_DIR',volume-driver=local' \
Instrumentale44d2f72018-08-16 17:22:45 -050071 ${PREFIX}${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
Instrumental71037c32018-03-26 13:51:48 -070072done