#!/bin/bash
-CADI_VERSION=2.1.2-SNAPSHOT
# Fill out "aaf.props" if not filled out already
if [ ! -e aaf.props ]; then
. ./aaf.props
-for V in VERSION AAF_FQDN AAF_FQDN_IP DEPLOY_FQI APP_FQDN APP_FQI VOLUME DRIVER LATITUDE LONGITUDE; do
+DOCKER=${DOCKER:=docker}
+CADI_VERSION=${CADI_VERSION:=2.1.5-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
unset DEF
case $V in
+ DOCKER_REPOSITORY)
+ PROMPT="Docker Repo"
+ DEF=""
+ ;;
AAF_FQDN) PROMPT="AAF's FQDN";;
DEPLOY_FQI) PROMPT="Deployer's FQI";;
AAF_FQDN_IP)
. ./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} \
--env LATITUDE=${LATITUDE} \
--env LONGITUDE=${LONGITUDE} \
--name aaf_agent_$USER \
- onap/aaf/aaf_agent:$VERSION \
+ "$PREFIX"onap/aaf/aaf_agent:$VERSION \
/bin/bash "$@"