mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-28 21:58:19 +00:00
add script execution from docker-entrypoint.d folder (#3666)
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
This commit is contained in:
committed by
GitHub
parent
488a1ac92e
commit
e9d89bb830
@@ -29,4 +29,29 @@ if ! whoami > /dev/null 2>&1; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# If we need to install some tools at entrypoint level, we can add shell scripts
|
||||
# in folder /docker-entrypoint.d/ with extension .sh and this scripts will be executed
|
||||
# at entrypount level.
|
||||
if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -maxdepth 1 -type f -print -quit 2>/dev/null | read v; then
|
||||
echo "/docker-entrypoint.d/ is not empty, will attempt to perform script execition"
|
||||
echo "Looking for shell scripts in /docker-entrypoint.d/"
|
||||
find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do
|
||||
case "$f" in
|
||||
*.sh)
|
||||
if [ -x "$f" ]; then
|
||||
echo "Launching $f";
|
||||
"$f"
|
||||
else
|
||||
# warn on shell scripts without exec bit
|
||||
echo "Ignoring $f, not executable";
|
||||
fi
|
||||
;;
|
||||
*) echo "Ignoring $f";;
|
||||
esac
|
||||
done
|
||||
echo "Configuration complete; ready for start up"
|
||||
else
|
||||
echo "No files found in /docker-entrypoint.d/, skipping"
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user