Skip to content

Commit

Permalink
Enhance custom-scripts (#263)
Browse files Browse the repository at this point in the history
Co-authored-by: Emilien Devos <[email protected]>
  • Loading branch information
f-necas and edevosc2c authored Nov 29, 2023
1 parent b17e8cb commit 8398db9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 2 additions & 0 deletions web/src/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ COPY --chown=jetty:jetty . /
# Temporary switch to root
USER root

RUN mkdir -p /docker-entrypoint.d
RUN chown jetty:jetty /docker-entrypoint.d
RUN mkdir -p /mnt/geonetwork_datadir && \
chown jetty:jetty /mnt/geonetwork_datadir

Expand Down
11 changes: 0 additions & 11 deletions web/src/docker/docker-entrypoint.d/100-execute-custom-scripts.sh

This file was deleted.

10 changes: 10 additions & 0 deletions web/src/docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@

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

Expand Down

0 comments on commit 8398db9

Please sign in to comment.