VOL-612 - rename images to work better with public repository

Change-Id: I9679544987c3a08d0001928cfbc39d710a6c1eae
diff --git a/install/voltha-swarm-start.sh b/install/voltha-swarm-start.sh
index cbd69e3..2dce5ad 100755
--- a/install/voltha-swarm-start.sh
+++ b/install/voltha-swarm-start.sh
@@ -64,6 +64,8 @@
 # If `REGISTRY` is set, but doesn't end in a `/`, then
 # add one
 test -z "$REGISTRY" -o "$(echo ${REGISTRY: -1})" == "/" || REGISTRY="$REGISTRY/"
+test -z "$REPOSITORY" -o "$(echo ${REPOSITORY: -1})" == "/" || REGISTRY="$REPOSITORY/"
+TAG=${TAG:-latest}
 
 # Attempt to count Ready Docker Swarm managers
 export SWARM_MANAGER_COUNT=$(docker node ls | grep Ready | egrep '(Leader)|(Reachable)' | wc -l | sed -e 's/ //g')
@@ -146,6 +148,6 @@
 
 
 TMP_STACK_FILE=$(mktemp -u)
-cat $BASE_DIR/compose/docker-compose-all.yml.j2 2>&1 | docker run -e SWARM_MANAGER_COUNT=$SWARM_MANAGER_COUNT --rm -i voltha/j2 - 2>&1 > $TMP_STACK_FILE
+cat $BASE_DIR/compose/docker-compose-all.yml.j2 2>&1 | docker run -e SWARM_MANAGER_COUNT=$SWARM_MANAGER_COUNT --rm -i ${REGISTRY}${REPOSITORY}voltha-j2:${TAG} - 2>&1 > $TMP_STACK_FILE
 docker stack deploy -c $TMP_STACK_FILE voltha
 rm -f $TMP_STACK_FILE
diff --git a/install/voltha-swarm-stop.sh b/install/voltha-swarm-stop.sh
index ebb4aea..df8595a 100755
--- a/install/voltha-swarm-stop.sh
+++ b/install/voltha-swarm-stop.sh
@@ -28,7 +28,9 @@
 
 usage() {
     echo >&2 "$PROG: [-d <dir>] [-l <log-dir>] [-h]"
-    echo >&2 "  -z              zero out the consul data"
+    echo >&2 "  -z              zero out the consul fluentd data"
+    echo >&2 "  -l <log-dir>    directory from which fluentd logs will be removed"
+    echo >&2 "  -c <consul-dir> directory from which consul data is removed"
     echo >&2 "  -h              this message"
 }
 
@@ -39,6 +41,7 @@
     case "$OPT" in
         z) VOLUME_CLEANUP=1;;
         c) export CONSUL_ROOT="$OPTARG";;
+        l) export VOLTHA_LOGS="$OPTARG";;
         h) usage;
            exit 1;;
         esac
@@ -88,7 +91,7 @@
 
 # Attempt to count Ready Docker Swarm managers
 SWARM_MANAGER_COUNT=$(docker node ls | grep Ready | egrep '(Leader)|(Reachable)' | wc -l)
-echo -n "[volume] consul ... "
+echo -n "[cleanup] consul and fluentd ... "
 if [ $VOLUME_CLEANUP -ne 0 ]; then
     RUNNING=$(docker service ps volume_cleanup 2> /dev/null | wc -l)
     if [ $RUNNING -ne 0 ]; then
@@ -98,8 +101,9 @@
     --mode=global --name=volume_cleanup \
     --mount=type=bind,src=${CONSUL_ROOT:-/cord/incubator/voltha/consul}/data,dst=/consul/data \
     --mount=type=bind,src=${CONSUL_ROOT:-/cord/incubator/voltha/consul}/config,dst=/consul/config \
+    --mount=type=bind,src=${VOLTHA_LOGS:-/var/log/voltha/logging_volume},dst=/fluentd/log \
     alpine:latest \
-    ash -c 'rm -rf /consul/data/* /consul/config/*' > /dev/null
+    ash -c 'rm -rf /consul/data/* /consul/config/* /fluentd/log/*' > /dev/null
 
     RETRY=10
     while [ $RETRY -ge 0 ]; do