Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 1 | #!/bin/bash |
Instrumental | 12f7f46 | 2018-04-23 15:43:47 -0500 | [diff] [blame] | 2 | # Pull in Variables from d.props |
Instrumental | f482ea0 | 2018-04-10 15:03:24 -0500 | [diff] [blame] | 3 | . ./d.props |
Sai Gandham | ce6a67f | 2018-04-10 14:25:35 +0000 | [diff] [blame] | 4 | |
Instrumental | 567a963 | 2018-08-14 13:55:32 -0500 | [diff] [blame] | 5 | # Only need Cassandra Link Info when initializing the container. |
| 6 | if [ ! -e ./cass.props ]; then |
| 7 | cp cass.props.init cass.props |
| 8 | echo "Edit appropriate Cassandra Link Info into cass.props" |
| 9 | exit |
| 10 | fi |
| 11 | |
| 12 | . ./cass.props |
| 13 | |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 14 | if [ "$1" == "" ]; then |
Instrumental | e44d2f7 | 2018-08-16 17:22:45 -0500 | [diff] [blame] | 15 | AAF_COMPONENTS=$(cat components) |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 16 | else |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 17 | AAF_COMPONENTS="$@" |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 18 | fi |
Instrumental | 679f142 | 2018-04-06 14:59:36 -0500 | [diff] [blame] | 19 | |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 20 | for 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' \ |
Instrumental | e44d2f7 | 2018-08-16 17:22:45 -0500 | [diff] [blame] | 60 | ${PREFIX}${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 61 | done |