X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fdocker%2Fagent.sh;h=45f5b43a37299562c89fd887e0b0c583d7e7018a;hb=e18eecbea001562d1e1a19cdccfe1684b3da05f7;hp=1ca12eb89548c855791f5a3f3dbf1128f447bde0;hpb=ca323313781c200570c56cb17e07174373af6d7a;p=aaf%2Fauthz.git diff --git a/auth/docker/agent.sh b/auth/docker/agent.sh index 1ca12eb8..45f5b43a 100644 --- a/auth/docker/agent.sh +++ b/auth/docker/agent.sh @@ -1,6 +1,5 @@ #!/bin/bash -CADI_VERSION=2.1.2-SNAPSHOT # Fill out "aaf.props" if not filled out already if [ ! -e aaf.props ]; then @@ -9,6 +8,8 @@ fi . ./aaf.props +DOCKER=${DOCKER:=docker} +CADI_VERSION=${CADI_VERSION:=2.1.6-SNAPSHOT} 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 @@ -16,7 +17,7 @@ for V in VERSION DOCKER_REPOSITORY AAF_FQDN AAF_FQDN_IP DEPLOY_FQI APP_FQDN APP_ case $V in DOCKER_REPOSITORY) PROMPT="Docker Repo" - DEF=nexus3.onap.org:10003 + DEF="" ;; AAF_FQDN) PROMPT="AAF's FQDN";; DEPLOY_FQI) PROMPT="Deployer's FQI";; @@ -53,15 +54,21 @@ done . ./aaf.props # Make sure Container Volume exists -if [ "$(docker volume ls | grep ${VOLUME})" = "" ]; then +if [ "$($DOCKER volume ls | grep ${VOLUME})" = "" ]; then echo -n "Creating Volume: " - docker volume create -d ${DRIVER} ${VOLUME} + $DOCKER volume create -d ${DRIVER} ${VOLUME} fi -docker run \ +if [ -n "$DOCKER_REPOSITORY" ]; then + PREFIX="$DOCKER_REPOSITORY/" +else + PREFIX="" +fi + +$DOCKER run \ -it \ --rm \ - --mount 'type=volume,src='${VOLUME}',dst=/opt/app/osaaf,volume-driver='${DRIVER} \ + -v "${VOLUME}:/opt/app/osaaf" \ --add-host="$AAF_FQDN:$AAF_FQDN_IP" \ --env AAF_FQDN=${AAF_FQDN} \ --env DEPLOY_FQI=${DEPLOY_FQI} \ @@ -71,5 +78,5 @@ docker run \ --env LATITUDE=${LATITUDE} \ --env LONGITUDE=${LONGITUDE} \ --name aaf_agent_$USER \ - $DOCKER_REPOSITORY/onap/aaf/aaf_agent:$VERSION \ + "$PREFIX"onap/aaf/aaf_agent:$VERSION \ /bin/bash "$@"