Skip to content
Snippets Groups Projects
Commit 66751285 authored by JuniorJPDJ's avatar JuniorJPDJ Committed by Konstantin Pavlov
Browse files

Source entrypoint files with .envsh extension

This allows reusing variables declared between entrypoint scripts
parent 1dca42f9
Branches
Tags
No related merge requests found
...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then ...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/" echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
case "$f" in case "$f" in
*.envsh)
if [ -x "$f" ]; then
echo >&3 "$0: Sourcing $f";
source "$f"
else
# warn on shell scripts without exec bit
echo >&3 "$0: Ignoring $f, not executable";
fi
;;
*.sh) *.sh)
if [ -x "$f" ]; then if [ -x "$f" ]; then
echo >&3 "$0: Launching $f"; echo >&3 "$0: Launching $f";
......
...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then ...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/" echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
case "$f" in case "$f" in
*.envsh)
if [ -x "$f" ]; then
echo >&3 "$0: Sourcing $f";
source "$f"
else
# warn on shell scripts without exec bit
echo >&3 "$0: Ignoring $f, not executable";
fi
;;
*.sh) *.sh)
if [ -x "$f" ]; then if [ -x "$f" ]; then
echo >&3 "$0: Launching $f"; echo >&3 "$0: Launching $f";
......
...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then ...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/" echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
case "$f" in case "$f" in
*.envsh)
if [ -x "$f" ]; then
echo >&3 "$0: Sourcing $f";
source "$f"
else
# warn on shell scripts without exec bit
echo >&3 "$0: Ignoring $f, not executable";
fi
;;
*.sh) *.sh)
if [ -x "$f" ]; then if [ -x "$f" ]; then
echo >&3 "$0: Launching $f"; echo >&3 "$0: Launching $f";
......
...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then ...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/" echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
case "$f" in case "$f" in
*.envsh)
if [ -x "$f" ]; then
echo >&3 "$0: Sourcing $f";
source "$f"
else
# warn on shell scripts without exec bit
echo >&3 "$0: Ignoring $f, not executable";
fi
;;
*.sh) *.sh)
if [ -x "$f" ]; then if [ -x "$f" ]; then
echo >&3 "$0: Launching $f"; echo >&3 "$0: Launching $f";
......
...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then ...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/" echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
case "$f" in case "$f" in
*.envsh)
if [ -x "$f" ]; then
echo >&3 "$0: Sourcing $f";
source "$f"
else
# warn on shell scripts without exec bit
echo >&3 "$0: Ignoring $f, not executable";
fi
;;
*.sh) *.sh)
if [ -x "$f" ]; then if [ -x "$f" ]; then
echo >&3 "$0: Launching $f"; echo >&3 "$0: Launching $f";
......
...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then ...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/" echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
case "$f" in case "$f" in
*.envsh)
if [ -x "$f" ]; then
echo >&3 "$0: Sourcing $f";
source "$f"
else
# warn on shell scripts without exec bit
echo >&3 "$0: Ignoring $f, not executable";
fi
;;
*.sh) *.sh)
if [ -x "$f" ]; then if [ -x "$f" ]; then
echo >&3 "$0: Launching $f"; echo >&3 "$0: Launching $f";
......
...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then ...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/" echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
case "$f" in case "$f" in
*.envsh)
if [ -x "$f" ]; then
echo >&3 "$0: Sourcing $f";
source "$f"
else
# warn on shell scripts without exec bit
echo >&3 "$0: Ignoring $f, not executable";
fi
;;
*.sh) *.sh)
if [ -x "$f" ]; then if [ -x "$f" ]; then
echo >&3 "$0: Launching $f"; echo >&3 "$0: Launching $f";
......
...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then ...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/" echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
case "$f" in case "$f" in
*.envsh)
if [ -x "$f" ]; then
echo >&3 "$0: Sourcing $f";
source "$f"
else
# warn on shell scripts without exec bit
echo >&3 "$0: Ignoring $f, not executable";
fi
;;
*.sh) *.sh)
if [ -x "$f" ]; then if [ -x "$f" ]; then
echo >&3 "$0: Launching $f"; echo >&3 "$0: Launching $f";
......
...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then ...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/" echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
case "$f" in case "$f" in
*.envsh)
if [ -x "$f" ]; then
echo >&3 "$0: Sourcing $f";
source "$f"
else
# warn on shell scripts without exec bit
echo >&3 "$0: Ignoring $f, not executable";
fi
;;
*.sh) *.sh)
if [ -x "$f" ]; then if [ -x "$f" ]; then
echo >&3 "$0: Launching $f"; echo >&3 "$0: Launching $f";
......
...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then ...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/" echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
case "$f" in case "$f" in
*.envsh)
if [ -x "$f" ]; then
echo >&3 "$0: Sourcing $f";
source "$f"
else
# warn on shell scripts without exec bit
echo >&3 "$0: Ignoring $f, not executable";
fi
;;
*.sh) *.sh)
if [ -x "$f" ]; then if [ -x "$f" ]; then
echo >&3 "$0: Launching $f"; echo >&3 "$0: Launching $f";
......
...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then ...@@ -16,6 +16,15 @@ if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/" echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
case "$f" in case "$f" in
*.envsh)
if [ -x "$f" ]; then
echo >&3 "$0: Sourcing $f";
source "$f"
else
# warn on shell scripts without exec bit
echo >&3 "$0: Ignoring $f, not executable";
fi
;;
*.sh) *.sh)
if [ -x "$f" ]; then if [ -x "$f" ]; then
echo >&3 "$0: Launching $f"; echo >&3 "$0: Launching $f";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment