From 7dea13aae8187fb0d078938b10d0093e80e328ff Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 1 Mar 2018 18:35:20 +0100 Subject: Add entrypoint for OpenShift which is waiting until ADEI sources are populated and ready... --- adei/Dockerfile | 2 +- adei/openshift-entrypoint.sh | 14 ++++++++++++++ adei/scripts/adei-branch.sh | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 adei/openshift-entrypoint.sh (limited to 'adei') diff --git a/adei/Dockerfile b/adei/Dockerfile index e0ee4ad..4d05961 100644 --- a/adei/Dockerfile +++ b/adei/Dockerfile @@ -66,7 +66,7 @@ ENV ADEI_PORTS 80 ENV APACHE_SERVERS 0 -COPY docker-entrypoint.sh / +COPY *-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 80 diff --git a/adei/openshift-entrypoint.sh b/adei/openshift-entrypoint.sh new file mode 100755 index 0000000..b4fc4f4 --- /dev/null +++ b/adei/openshift-entrypoint.sh @@ -0,0 +1,14 @@ +#! /bin/bash + +while [ ! -f /adei/cfg/.ready ]; do + echo "Waiting for ADEI intialization..." + sleep 5 +done + +while [ ! -f "$1" ]; do + echo "The script $1 is not populated yet. Waiting...." + sleep 1 +done + +echo "Running: $@" +exec /bin/bash "$@" diff --git a/adei/scripts/adei-branch.sh b/adei/scripts/adei-branch.sh index 64d37a4..4ba77ac 100755 --- a/adei/scripts/adei-branch.sh +++ b/adei/scripts/adei-branch.sh @@ -70,4 +70,6 @@ LOCK_FILE=.lock fi done ) + + touch /adei/cfg/.ready ) 10> /adei/cfg/$LOCK_FILE 11> /adei/src/$LOCK_FILE -- cgit v1.2.3