summaryrefslogtreecommitdiffstats
path: root/auth/docker/agent.sh
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-02-15 19:40:04 -0600
committerInstrumental <jonathan.gathman@att.com>2019-02-15 20:04:29 -0600
commit628b7105ce4d9818aac69a082e515f9275fd46fd (patch)
tree3f1e073e6973efd06f950a70a12499976027eae4 /auth/docker/agent.sh
parent4b6435c97dc1e05ee6a1e06190e3c431f9d1a8fe (diff)
Batch work and client
Issue-ID: AAF-740 Change-Id: I16da4f2a87ec5d19590f0af642b91f9e2e02b246 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/docker/agent.sh')
-rw-r--r--auth/docker/agent.sh28
1 files changed, 23 insertions, 5 deletions
diff --git a/auth/docker/agent.sh b/auth/docker/agent.sh
index 86fee5f6..a2b11830 100644
--- a/auth/docker/agent.sh
+++ b/auth/docker/agent.sh
@@ -90,11 +90,16 @@ else
PREFIX=""
fi
-$DOCKER run \
- -it \
- --rm \
+function run_it() {
+ LINKS="--link aaf-locate"
+ if [ -n "${DUSER}" ]; then
+ USER_LINE="--user ${DUSER}"
+ fi
+ $DOCKER run -it --rm \
+ ${USER_LINE} \
-v "${VOLUME}:/opt/app/osaaf" \
--add-host="$AAF_FQDN:$AAF_FQDN_IP" \
+ $LINKS \
--env AAF_FQDN=${AAF_FQDN} \
--env DEPLOY_FQI=${DEPLOY_FQI} \
--env DEPLOY_PASSWORD=${DEPLOY_PASSWORD} \
@@ -102,6 +107,19 @@ $DOCKER run \
--env APP_FQDN=${APP_FQDN} \
--env LATITUDE=${LATITUDE} \
--env LONGITUDE=${LONGITUDE} \
- --name aaf_agent_$USER \
+ --name aaf-agent-$USER \
"$PREFIX"onap/aaf/aaf_agent:$VERSION \
- /bin/bash "$@"
+ bash -c "bash /opt/app/aaf_config/bin/agent.sh $PARAMS"
+}
+
+PARAMS=$@
+case "$1" in
+ bash)
+ PARAMS="&& cd /opt/app/osaaf/local && exec bash"
+ run_it -it --rm
+ ;;
+ *)
+ run_it --rm
+ ;;
+esac
+