Merge "Attrib.java: Fixed sonar issue"
[aaf/authz.git] / auth / docker / drun.sh
index c62adfc..2eb025e 100644 (file)
@@ -2,8 +2,26 @@
 # Pull in Variables from d.props
 . ./d.props
 
+# Only need Cassandra Link Info when initializing the container.
+if [ ! -e ./cass.props ]; then
+    cp cass.props.init cass.props
+fi
+
+CASS_IS_SET="$(grep '<Cass IP>' cass.props)"
+if [ -n "$CASS_IS_SET" ]; then
+    CASS_IP="$(docker container inspect aaf_cass | grep \"IPAddress\": -m 1 | cut -d '"' -f 4)"
+    if [ -n "$CASS_IP" ]; then
+      sed -i -e "s/\(^.*:\).*/\1$CASS_IP/" cass.props
+    else
+      echo "Set CASSASNDRA IP in cass.props"
+      exit
+    fi
+fi
+
+. ./cass.props
+
 if [ "$1" == "" ]; then
-    AAF_COMPONENTS=$(ls -r ../aaf_${VERSION}/bin | grep -v '\.')
+    AAF_COMPONENTS=$(cat components)
 else
     AAF_COMPONENTS="$@"
 fi
@@ -48,5 +66,5 @@ for AAF_COMPONENT in ${AAF_COMPONENTS}; do
         ${LINKS} \
         --publish $PORTMAP \
         --mount 'type=volume,src=aaf_config,dst='$CONF_ROOT_DIR',volume-driver=local' \
-        ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
+        ${PREFIX}${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
 done