summaryrefslogtreecommitdiffstats
path: root/auth/docker
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2018-11-02 09:39:54 -0500
committerInstrumental <jonathan.gathman@att.com>2018-11-02 09:40:06 -0500
commit365a488884271caf30f05256a9437a873ccda81a (patch)
tree6d7124e105d566cfae02fcb3d5b97aaa86fe2702 /auth/docker
parentce8676cf8e92559c8149e6e382dea208e348c5de (diff)
Improve Docker start
For Docker style starts, pull in CASS_HOST info automatically Issue-ID: AAF-603 Change-Id: Ia0b2e73eb34c29d028c7c1d3f9c19705e4176159 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/docker')
-rw-r--r--auth/docker/.gitignore1
-rw-r--r--auth/docker/drun.sh24
2 files changed, 25 insertions, 0 deletions
diff --git a/auth/docker/.gitignore b/auth/docker/.gitignore
index 8aa26850..d3c3ab60 100644
--- a/auth/docker/.gitignore
+++ b/auth/docker/.gitignore
@@ -1,5 +1,6 @@
/local
/d.props
+/d.props.bak
/aaf.props
/cass.props
/policy*
diff --git a/auth/docker/drun.sh b/auth/docker/drun.sh
index ad1fb504..1b442368 100644
--- a/auth/docker/drun.sh
+++ b/auth/docker/drun.sh
@@ -1,4 +1,24 @@
#!/bin/bash
+# Validate for realtime Cassandra info
+
+# check if outside Cluster defined... otherwise, set CASS_HOST for using expected Docker based Cass
+if [ -z "$(grep -e '^CASS_CLUSTER=.*' d.props)" ]; then
+ if [ "$(uname)" = "Darwin" ]; then
+ SED="sed -i .bak"
+ else
+ SED="sed -i"
+ fi
+
+ CASSANDRA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' aaf_cass)
+ if [ -z "$(grep -e '^CASS_HOST.*' d.props)" ]; then
+ $SED "s/# CASS_HOST=.*/CASS_HOST=cass.aaf.osaaf.org:$CASSANDRA_IP/" d.props
+ else
+ $SED "s/CASS_HOST=.*/CASS_HOST=cass.aaf.osaaf.org:$CASSANDRA_IP/" d.props
+ fi
+ echo "Updated d.props for CASSANDRA Name/IP"
+ grep -e '^CASS_HOST.*' d.props
+fi
+
# Pull in Variables from d.props
. ./d.props
@@ -53,6 +73,10 @@ for AAF_COMPONENT in ${AAF_COMPONENTS}; do
ADD_HOST="$ADD_HOST --add-host=$A:$HOST_IP"
done
+ if [[ "$CASS_HOST" =~ ":" ]]; then
+ echo "Adding Cassandra Host $CASS_HOST"
+ ADD_HOST="$ADD_HOST --add-host=$CASS_HOST"
+ fi
$DOCKER run \
-d \
--name aaf_$AAF_COMPONENT \