3 CADI_VERSION=2.1.2-SNAPSHOT
5 # Fill out "aaf.props" if not filled out already
6 if [ ! -e aaf.props ]; then
9 for V in VERSION AAF_FQDN DEPLOY_FQI APP_FQDN APP_FQI VOLUME DRIVER LATITUDE LONGITUDE; do
10 if [ "$(grep $V ./aaf.props)" = "" ]; then
13 AAF_FQDN) PROMPT="AAF's FQDN";;
14 DEPLOY_FQI) PROMPT="Deployer's FQI";;
15 APP_FQI) PROMPT="App's FQI";;
16 APP_FQDN) PROMPT="App's Root FQDN";;
17 VOLUME) PROMPT="APP's AAF Configuration Volume";;
18 DRIVER) PROMPT=$V;DEF=local;;
19 VERSION) PROMPT="CADI Version";DEF=$CADI_VERSION;;
20 LATITUDE|LONGITUDE) PROMPT="$V of Node";;
23 if [ "$DEF" = "" ]; then
26 PROMPT="$PROMPT ($DEF): "
29 if [ "$VAR" = "" ]; then
30 if [ "$DEF" = "" ]; then
31 echo "agent.sh needs each value queried. Please start again."
37 echo "$V=$VAR" >> ./aaf.props
42 # Need AAF_FQDN's IP, because not might not be available in mini-container
43 if [ "$AAF_AAF_FQDN_IP" = "" ]; then
44 AAF_AAF_FQDN_IP=$(host $AAF_FQDN | grep "has address" | tail -1 | cut -f 4 -d ' ')
45 if [ "$AAF_AAF_FQDN_IP" = "" ]; then
46 read -p "IP of $AAF_FQDN: " AAF_AAF_FQDN_IP
47 echo "AAF_AAF_FQDN_IP=$AAF_AAF_FQDN_IP" >> ./aaf.props
51 # Make sure Container Volume exists
52 if [ "$(docker volume ls | grep ${VOLUME})" = "" ]; then
53 echo -n "Creating Volume: "
54 docker volume create -d ${DRIVER} ${VOLUME}
60 --mount 'type=volume,src='${VOLUME}',dst=/opt/app/osaaf,volume-driver='${DRIVER} \
61 --add-host="$AAF_FQDN:$AAF_AAF_FQDN_IP" \
62 --env AAF_FQDN=${AAF_FQDN} \
63 --env DEPLOY_FQI=${DEPLOY_FQI} \
64 --env DEPLOY_PASSWORD=${DEPLOY_PASSWORD} \
65 --env APP_FQI=${APP_FQI} \
66 --env APP_FQDN=${APP_FQDN} \
67 --env LATITUDE=${LATITUDE} \
68 --env LONGITUDE=${LONGITUDE} \
69 --name aaf_agent_$USER \
70 onap/aaf/aaf_agent:$VERSION \