Instrumental | 97083ef | 2018-04-25 15:22:38 -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 | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 5 | # Create Volumes, if not exist already |
| 6 | for VOL in aaf_config aaf_cass_data; do |
| 7 | HAS_VOLUME=`docker volume ls | grep $VOL` |
| 8 | if [ "$HAS_VOLUME" = "" ]; then |
| 9 | docker volume create --name $VOL |
| 10 | fi |
| 11 | done |
| 12 | docker run \ |
| 13 | -d \ |
| 14 | --name aaf_config \ |
| 15 | --mount 'type=volume,src=aaf_config,dst=/opt/app/osaaf,volume-driver=local' \ |
| 16 | ${ORG}/${PROJECT}/aaf_agent:${VERSION} |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 17 | |
| 18 | if [ "$1" == "" ]; then |
Instrumental | ac836d0 | 2018-04-06 05:27:41 -0500 | [diff] [blame] | 19 | AAF_COMPONENTS=`ls -r ../aaf_${VERSION}/bin | grep -v '\.'` |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 20 | else |
| 21 | AAF_COMPONENTS=$1 |
| 22 | fi |
| 23 | |
| 24 | for AAF_COMPONENT in ${AAF_COMPONENTS}; do |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 25 | case "$AAF_COMPONENT" in |
Instrumental | 679f142 | 2018-04-06 14:59:36 -0500 | [diff] [blame] | 26 | "service") |
| 27 | PORTMAP="8100:8100" |
| 28 | LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" |
| 29 | ;; |
| 30 | "locate") |
| 31 | PORTMAP="8095:8095" |
| 32 | LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" |
| 33 | ;; |
| 34 | "oauth") |
| 35 | PORTMAP="8140:8140" |
| 36 | LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" |
| 37 | ;; |
| 38 | "gui") |
| 39 | PORTMAP="8200:8200" |
| 40 | ;; |
| 41 | "cm") |
| 42 | PORTMAP="8150:8150" |
| 43 | LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" |
| 44 | ;; |
| 45 | "hello") |
| 46 | PORTMAP="8130:8130" |
| 47 | ;; |
| 48 | "fs") |
| 49 | PORTMAP="80:8096" |
| 50 | ;; |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 51 | esac |
| 52 | |
Instrumental | ac836d0 | 2018-04-06 05:27:41 -0500 | [diff] [blame] | 53 | echo Starting aaf_$AAF_COMPONENT... |
Instrumental | 679f142 | 2018-04-06 14:59:36 -0500 | [diff] [blame] | 54 | |
Instrumental | ac836d0 | 2018-04-06 05:27:41 -0500 | [diff] [blame] | 55 | docker run \ |
Instrumental | 1efda07 | 2018-04-24 07:08:05 -0500 | [diff] [blame] | 56 | -d \ |
Instrumental | ac836d0 | 2018-04-06 05:27:41 -0500 | [diff] [blame] | 57 | --name aaf_$AAF_COMPONENT \ |
Instrumental | 679f142 | 2018-04-06 14:59:36 -0500 | [diff] [blame] | 58 | --hostname="${AAF_COMPONENT}.aaf.osaaf.org" \ |
| 59 | --add-host="$HOSTNAME:$HOST_IP" \ |
| 60 | --add-host="aaf.osaaf.org:$HOST_IP" \ |
| 61 | ${LINKS} \ |
Instrumental | ac836d0 | 2018-04-06 05:27:41 -0500 | [diff] [blame] | 62 | --publish $PORTMAP \ |
| 63 | --mount type=bind,source=$CONF_ROOT_DIR,target=/opt/app/osaaf \ |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 64 | ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 65 | done |