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 | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 5 | DOCKER=${DOCKER:=docker} |
Instrumental | a05704f | 2018-09-17 13:58:02 -0500 | [diff] [blame] | 6 | |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 7 | bash aaf.sh onap |
| 8 | |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 9 | if [ "$1" == "" ]; then |
Instrumental | e44d2f7 | 2018-08-16 17:22:45 -0500 | [diff] [blame] | 10 | AAF_COMPONENTS=$(cat components) |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 11 | else |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 12 | AAF_COMPONENTS="$@" |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 13 | fi |
Instrumental | 679f142 | 2018-04-06 14:59:36 -0500 | [diff] [blame] | 14 | |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 15 | for AAF_COMPONENT in ${AAF_COMPONENTS}; do |
| 16 | case "$AAF_COMPONENT" in |
| 17 | "service") |
| 18 | PORTMAP="8100:8100" |
Instrumental | c03496d | 2018-10-19 13:59:24 -0500 | [diff] [blame] | 19 | LINKS="--link aaf_cass:cassandra " |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 20 | ;; |
| 21 | "locate") |
| 22 | PORTMAP="8095:8095" |
Instrumental | c03496d | 2018-10-19 13:59:24 -0500 | [diff] [blame] | 23 | LINKS="--link aaf_cass:cassandra " |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 24 | ;; |
| 25 | "oauth") |
| 26 | PORTMAP="8140:8140" |
Instrumental | c03496d | 2018-10-19 13:59:24 -0500 | [diff] [blame] | 27 | LINKS="--link aaf_cass:cassandra " |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 28 | ;; |
| 29 | "gui") |
| 30 | PORTMAP="8200:8200" |
| 31 | ;; |
| 32 | "cm") |
| 33 | PORTMAP="8150:8150" |
Instrumental | 93871ff | 2018-10-15 07:37:28 -0500 | [diff] [blame] | 34 | LINKS="--link aaf_cass:cassandra " |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 35 | ;; |
| 36 | "hello") |
| 37 | PORTMAP="8130:8130" |
| 38 | ;; |
| 39 | "fs") |
| 40 | PORTMAP="80:8096" |
| 41 | ;; |
| 42 | esac |
| 43 | |
| 44 | echo Starting aaf_$AAF_COMPONENT... |
| 45 | |
Instrumental | 1e3be60 | 2018-10-03 19:40:44 -0500 | [diff] [blame] | 46 | 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" |
Instrumental | 1e3be60 | 2018-10-03 19:40:44 -0500 | [diff] [blame] | 54 | done |
| 55 | |
Instrumental | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 56 | $DOCKER run \ |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 57 | -d \ |
| 58 | --name aaf_$AAF_COMPONENT \ |
| 59 | --hostname="${AAF_COMPONENT}.aaf.osaaf.org" \ |
Instrumental | 1e3be60 | 2018-10-03 19:40:44 -0500 | [diff] [blame] | 60 | $ADD_HOST \ |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 61 | ${LINKS} \ |
Instrumental | 1e3be60 | 2018-10-03 19:40:44 -0500 | [diff] [blame] | 62 | --env AAF_ENV=${AAF_ENV} \ |
| 63 | --env AAF_REGISTER_AS=${AAF_REGISTER_AS} \ |
| 64 | --env LATITUDE=${LATITUDE} \ |
| 65 | --env LONGITUDE=${LONGITUDE} \ |
Instrumental | eccc902 | 2018-10-24 13:18:57 -0500 | [diff] [blame] | 66 | --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} \ |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 71 | --publish $PORTMAP \ |
Instrumental | 9405361 | 2018-10-08 11:27:18 -0500 | [diff] [blame] | 72 | -v "aaf_config:$CONF_ROOT_DIR" \ |
Instrumental | e44d2f7 | 2018-08-16 17:22:45 -0500 | [diff] [blame] | 73 | ${PREFIX}${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} |
Instrumental | 71037c3 | 2018-03-26 13:51:48 -0700 | [diff] [blame] | 74 | done |