summaryrefslogtreecommitdiffstats
path: root/aai-resources/src/main/docker/docker-entrypoint.sh
diff options
context:
space:
mode:
authorKajur, Harish (vk250x) <vk250x@att.com>2018-03-29 00:38:13 -0400
committerKajur, Harish (vk250x) <vk250x@att.com>2018-03-29 01:00:19 -0400
commit5b77bf9d7587f8f3c5add03285507e2368603353 (patch)
treeb8574a8d6114a2c06469592cd4f5026191dc6c3b /aai-resources/src/main/docker/docker-entrypoint.sh
parent6ec9d8c6129881e6c789c0e2214d3d548015b299 (diff)
Update docker entrypoint to run independent
Issue-ID: AAI-949 Change-Id: Ie8a2967c7db4d8632c2485389ab735c5420d6edd Signed-off-by: Kajur, Harish (vk250x) <vk250x@att.com>
Diffstat (limited to 'aai-resources/src/main/docker/docker-entrypoint.sh')
-rw-r--r--aai-resources/src/main/docker/docker-entrypoint.sh28
1 files changed, 27 insertions, 1 deletions
diff --git a/aai-resources/src/main/docker/docker-entrypoint.sh b/aai-resources/src/main/docker/docker-entrypoint.sh
index d268888..6f9ed65 100644
--- a/aai-resources/src/main/docker/docker-entrypoint.sh
+++ b/aai-resources/src/main/docker/docker-entrypoint.sh
@@ -54,7 +54,33 @@ if [ -f ${APP_HOME}/aai.sh ]; then
mv ${APP_HOME}/aai.sh /etc/profile.d/aai.sh
chmod 755 /etc/profile.d/aai.sh
- gosu aaiadmin /opt/app/aai-resources/scripts/createDBSchema.sh || exit 1
+ scriptName=$1;
+
+ if [ ! -z $scriptName ]; then
+
+ if [ -f ${APP_HOME}/bin/${scriptName} ]; then
+ shift 1;
+ gosu aaiadmin ${APP_HOME}/bin/${scriptName} "$@" || {
+ echo "Failed to run the ${scriptName}";
+ exit 1;
+ }
+ else
+ echo "Unable to find the script ${scriptName} in ${APP_HOME}/bin";
+ exit 1;
+ fi;
+
+ exit 0;
+ fi;
+
+
+ # If in the environment file skip create db schema there is a value set
+ # Then it will skip the create db schema at startup
+ # This is a workaround that will be there temporarily
+ # Ideally createDBSchema should be run from chef
+ # Or run without having to startup the application
+ if [ -z ${SKIP_CREATE_DB_SCHEMA_AT_STARTUP} ]; then
+ gosu aaiadmin /opt/app/aai-resources/scripts/createDBSchema.sh || exit 1
+ fi;
fi;
JAVA_CMD="exec gosu aaiadmin java";