From c6557f9fc325d9cb5376b5c04096f059bdb46940 Mon Sep 17 00:00:00 2001 From: Krzysztof Kwiecien Date: Fri, 15 Sep 2017 20:21:03 +0200 Subject: run updateQueryData.sh in docker-entrypoint this script will upload defined named query to the aai-traversal service Change the docker-entrypoint script to wait for resources and then start the named query after resource is up and start the traversal app as the main app Issue-ID: AAI-307 Change-Id: I7a0a4a97cc63eb5d3d1c9a31c908726a8c0af1e9 Signed-off-by: Krzysztof Kwiecien Signed-off-by: Venkata Harish K Kajur --- .../src/main/resources/docker/docker-entrypoint.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'aai-traversal/src') diff --git a/aai-traversal/src/main/resources/docker/docker-entrypoint.sh b/aai-traversal/src/main/resources/docker/docker-entrypoint.sh index 52c6bfa..464683a 100644 --- a/aai-traversal/src/main/resources/docker/docker-entrypoint.sh +++ b/aai-traversal/src/main/resources/docker/docker-entrypoint.sh @@ -19,7 +19,7 @@ ### # Set the current path to be the application home and common libs home -APP_HOME=$(pwd); +export APP_HOME=$(pwd); COMMONLIBS_HOME="/opt/app/commonLibs"; export CHEF_CONFIG_REPO=${CHEF_CONFIG_REPO:-aai-config}; @@ -27,6 +27,9 @@ export CHEF_GIT_URL=${CHEF_GIT_URL:-http://gerrit.onap.org/r/aai}; export CHEF_CONFIG_GIT_URL=${CHEF_CONFIG_GIT_URL:-$CHEF_GIT_URL}; export CHEF_DATA_GIT_URL=${CHEF_DATA_GIT_URL:-$CHEF_GIT_URL}; +export RESOURCES_HOSTNAME=${RESOURCES_HOSTNAME:-aai-resources.api.simpledemo.openecomp.org}; +export RESOURCES_PORT=${RESOURCES_PORT:-8447}; + USER_ID=${LOCAL_USER_ID:-9001} if [ $(cat /etc/passwd | grep aaiadmin | wc -l) -eq 0 ]; then @@ -45,6 +48,21 @@ httpsPort=8446; cd ${APP_HOME}; +# If the variable DISABLE_UPDATE_QUERY is empty +# then the update query date shell script will be ran +# This makes it configurable to run update query or not + +if [ -z ${DISABLE_UPDATE_QUERY} ]; then + + while ! nc -z ${RESOURCES_HOSTNAME} ${RESOURCES_PORT} ; + do + echo "Waiting for resources to be up"; + sleep 5; + done + + /opt/app/aai-traversal/bin/install/updateQueryData.sh +fi + CP=${COMMONLIBS_HOME}/*; CP="$CP":${APP_HOME}/etc; CP="$CP":${APP_HOME}/lib/*; -- cgit 1.2.3-korg