blob: ad1fb5042989411ddc213add3597d11bc7832dfc [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
Instrumental94053612018-10-08 11:27:18 -05005DOCKER=${DOCKER:=docker}
Instrumentala05704f2018-09-17 13:58:02 -05006
Instrumentalbc299c02018-09-25 06:42:31 -05007bash aaf.sh onap
8
Instrumental71037c32018-03-26 13:51:48 -07009if [ "$1" == "" ]; then
Instrumentale44d2f72018-08-16 17:22:45 -050010 AAF_COMPONENTS=$(cat components)
Instrumental71037c32018-03-26 13:51:48 -070011else
Instrumental4ad47632018-07-13 15:49:26 -050012 AAF_COMPONENTS="$@"
Instrumental71037c32018-03-26 13:51:48 -070013fi
Instrumental679f1422018-04-06 14:59:36 -050014
Instrumental4ad47632018-07-13 15:49:26 -050015for AAF_COMPONENT in ${AAF_COMPONENTS}; do
16 case "$AAF_COMPONENT" in
17 "service")
18 PORTMAP="8100:8100"
Instrumentalc03496d2018-10-19 13:59:24 -050019 LINKS="--link aaf_cass:cassandra "
Instrumental4ad47632018-07-13 15:49:26 -050020 ;;
21 "locate")
22 PORTMAP="8095:8095"
Instrumentalc03496d2018-10-19 13:59:24 -050023 LINKS="--link aaf_cass:cassandra "
Instrumental4ad47632018-07-13 15:49:26 -050024 ;;
25 "oauth")
26 PORTMAP="8140:8140"
Instrumentalc03496d2018-10-19 13:59:24 -050027 LINKS="--link aaf_cass:cassandra "
Instrumental4ad47632018-07-13 15:49:26 -050028 ;;
29 "gui")
30 PORTMAP="8200:8200"
31 ;;
32 "cm")
33 PORTMAP="8150:8150"
Instrumental93871ff2018-10-15 07:37:28 -050034 LINKS="--link aaf_cass:cassandra "
Instrumental4ad47632018-07-13 15:49:26 -050035 ;;
36 "hello")
37 PORTMAP="8130:8130"
38 ;;
39 "fs")
40 PORTMAP="80:8096"
41 ;;
42 esac
43
44 echo Starting aaf_$AAF_COMPONENT...
45
Instrumental1e3be602018-10-03 19:40:44 -050046 if [ -n "$AAF_REGISTER_AS" ] && [ "$HOSTNAME" != "$AAF_REGISTER_AS" ]; then
47 AH_ROOT="$HOSTNAME $AAF_REGISTER_AS"
48 else
49 AH_ROOT="$HOSTNAME"
50 fi
51
52 for A in aaf.osaaf.org $AH_ROOT; do
53 ADD_HOST="$ADD_HOST --add-host=$A:$HOST_IP"
Instrumental1e3be602018-10-03 19:40:44 -050054 done
55
Instrumental94053612018-10-08 11:27:18 -050056 $DOCKER run \
Instrumental4ad47632018-07-13 15:49:26 -050057 -d \
58 --name aaf_$AAF_COMPONENT \
59 --hostname="${AAF_COMPONENT}.aaf.osaaf.org" \
Instrumental1e3be602018-10-03 19:40:44 -050060 $ADD_HOST \
Instrumental4ad47632018-07-13 15:49:26 -050061 ${LINKS} \
Instrumental1e3be602018-10-03 19:40:44 -050062 --env AAF_ENV=${AAF_ENV} \
63 --env AAF_REGISTER_AS=${AAF_REGISTER_AS} \
64 --env LATITUDE=${LATITUDE} \
65 --env LONGITUDE=${LONGITUDE} \
Instrumentaleccc9022018-10-24 13:18:57 -050066 --env CASS_HOST=${CASS_HOST} \
67 --env CASSANDRA_CLUSTER=${CASSANDRA_CLUSTER} \
68 --env CASSANDRA_USER=${CASSANDRA_USER} \
69 --env CASSANDRA_PASSWORD=${CASSANDRA_PASSWORD} \
70 --env CASSANDRA_PORT=${CASSANDRA_PORT} \
Instrumental4ad47632018-07-13 15:49:26 -050071 --publish $PORTMAP \
Instrumental94053612018-10-08 11:27:18 -050072 -v "aaf_config:$CONF_ROOT_DIR" \
Instrumentale44d2f72018-08-16 17:22:45 -050073 ${PREFIX}${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
Instrumental71037c32018-03-26 13:51:48 -070074done