JUnits for Mapper_2_0
[aaf/authz.git] / auth / docker / agent.sh
index aa3db66..1ca12eb 100644 (file)
@@ -6,12 +6,25 @@ CADI_VERSION=2.1.2-SNAPSHOT
 if [ ! -e aaf.props ]; then
   > ./aaf.props
 fi
-for V in VERSION AAF_FQDN DEPLOY_FQI APP_FQDN APP_FQI VOLUME DRIVER LATITUDE LONGITUDE; do
+. ./aaf.props
+
+
+for V in VERSION DOCKER_REPOSITORY AAF_FQDN AAF_FQDN_IP DEPLOY_FQI APP_FQDN APP_FQI VOLUME DRIVER LATITUDE LONGITUDE; do
    if [ "$(grep $V ./aaf.props)" = "" ]; then
       unset DEF
       case $V in
+        DOCKER_REPOSITORY) 
+               PROMPT="Docker Repo"
+               DEF=nexus3.onap.org:10003
+               ;;
          AAF_FQDN)   PROMPT="AAF's FQDN";;
          DEPLOY_FQI) PROMPT="Deployer's FQI";;
+         AAF_FQDN_IP)
+               # Need AAF_FQDN's IP, because not might not be available in mini-container
+               PROMPT="AAF FQDN IP"
+               DEF=$(host $AAF_FQDN | grep "has address" | tail -1 | cut -f 4 -d ' ')
+                ;;
          APP_FQI)    PROMPT="App's FQI";; 
          APP_FQDN)   PROMPT="App's Root FQDN";; 
          VOLUME)     PROMPT="APP's AAF Configuration Volume";;
@@ -39,15 +52,6 @@ for V in VERSION AAF_FQDN DEPLOY_FQI APP_FQDN APP_FQI VOLUME DRIVER LATITUDE LON
 done
 . ./aaf.props
 
-# Need AAF_FQDN's IP, because not might not be available in mini-container
-if [ "$AAF_AAF_FQDN_IP" = "" ]; then
-  AAF_AAF_FQDN_IP=$(host $AAF_FQDN | grep "has address" | tail -1 | cut -f 4 -d ' ')
-  if [ "$AAF_AAF_FQDN_IP" = "" ]; then
-    read -p "IP of $AAF_FQDN: " AAF_AAF_FQDN_IP
-    echo "AAF_AAF_FQDN_IP=$AAF_AAF_FQDN_IP" >> ./aaf.props
-  fi
-fi
-
 # Make sure Container Volume exists
 if [ "$(docker volume ls | grep ${VOLUME})" = "" ]; then
   echo -n "Creating Volume: " 
@@ -58,7 +62,7 @@ docker run \
     -it \
     --rm \
     --mount 'type=volume,src='${VOLUME}',dst=/opt/app/osaaf,volume-driver='${DRIVER} \
-    --add-host="$AAF_FQDN:$AAF_AAF_FQDN_IP" \
+    --add-host="$AAF_FQDN:$AAF_FQDN_IP" \
     --env AAF_FQDN=${AAF_FQDN} \
     --env DEPLOY_FQI=${DEPLOY_FQI} \
     --env DEPLOY_PASSWORD=${DEPLOY_PASSWORD} \
@@ -67,5 +71,5 @@ docker run \
     --env LATITUDE=${LATITUDE} \
     --env LONGITUDE=${LONGITUDE} \
     --name aaf_agent_$USER \
-    onap/aaf/aaf_agent:$VERSION \
+    $DOCKER_REPOSITORY/onap/aaf/aaf_agent:$VERSION \
     /bin/bash "$@"