summaryrefslogtreecommitdiffstats
path: root/aai-traversal/src/main/resources
diff options
context:
space:
mode:
authorKrzysztof Kwiecien <krzysztof.kwiecien1@orange.com>2017-09-15 20:21:03 +0200
committerVenkata Harish K Kajur <vk250x@att.com>2017-09-19 05:12:59 +0000
commitc6557f9fc325d9cb5376b5c04096f059bdb46940 (patch)
treea253399c19fde9adf8315b35f558fc4aa049e043 /aai-traversal/src/main/resources
parent277be05aa962be97bed336acaafb808185fd20e9 (diff)
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 <krzysztof.kwiecien1@orange.com> Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
Diffstat (limited to 'aai-traversal/src/main/resources')
-rw-r--r--aai-traversal/src/main/resources/docker/docker-entrypoint.sh20
1 files changed, 19 insertions, 1 deletions
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/*;