-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #669 from georchestra/startup-script
Enhance custom-scripts (#671) * feat: add custom scripts support in entrypoint.sh * fix: update command in comment * fix: remove comment
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ coverage/ | |
backend/.classpath | ||
backend/.project | ||
package-lock.json | ||
.idea/ | ||
docker/*.war |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
DIR=/docker-entrypoint.d | ||
|
||
# Executing custom scripts located in CUSTOM_SCRIPTS_DIRECTORY if environment variable is set | ||
if [[ -z "${CUSTOM_SCRIPTS_DIRECTORY}" ]]; then | ||
echo "[INFO] No CUSTOM_SCRIPTS_DIRECTORY env variable set" | ||
else | ||
echo "[INFO] CUSTOM_SCRIPTS_DIRECTORY env variable set to ${CUSTOM_SCRIPTS_DIRECTORY}" | ||
cp -v "${CUSTOM_SCRIPTS_DIRECTORY}"/* "$DIR" | ||
echo "[INFO] End copying custom scripts" | ||
fi | ||
|
||
if [[ -d "$DIR" ]] | ||
then | ||
# Regex is needed to execute all kind of files, including sh files. Warning : --regex not available in alpine images. | ||
/bin/run-parts --verbose "$DIR" --regex='.*' | ||
fi | ||
|
||
exec "$@" |