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 |
Instrumental | a05704f | 2018-09-17 13:58:02 -0500 | [diff] [blame] | 8 | fi |
| 9 | |
| 10 | CASS_IS_SET="$(grep '<Cass IP>' cass.props)" |
| 11 | if [ -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 |
Instrumental | 567a963 | 2018-08-14 13:55:32 -0500 | [diff] [blame] | 19 | fi |
| 20 | |
| 21 | . ./cass.props |
| 22 | |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 23 | bash aaf.sh onap |
| 24 | |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 25 | if [ "$1" == "" ]; then |
Instrumental | e44d2f7 | 2018-08-16 17:22:45 -0500 | [diff] [blame] | 26 | AAF_COMPONENTS=$(cat components) |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 27 | else |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 28 | AAF_COMPONENTS="$@" |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 29 | fi |
Instrumental | 679f142 | 2018-04-06 14:59:36 -0500 | [diff] [blame] | 30 | |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 31 | for 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' \ |
Instrumental | e44d2f7 | 2018-08-16 17:22:45 -0500 | [diff] [blame] | 71 | ${PREFIX}${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 72 | done |