Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement custom scripts for mapstore #669

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ coverage/
backend/.classpath
backend/.project
package-lock.json
.idea/
docker/*.war
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ RUN if [ "$TOMCAT_EXTRAS" = false ]; then \

# Add application from first stage
COPY --from=extractwar /tmp/mapstore "${CATALINA_BASE}/webapps/mapstore"
COPY georchestra-docker-scripts/ /


# Geostore externalization template. Disabled by default
# COPY docker/geostore-datasource-ovr.properties "${CATALINA_BASE}/conf/"
Expand All @@ -30,4 +32,7 @@ ENV JAVA_OPTS="${JAVA_OPTS} ${GEORCHESTRA_DATADIR_OPT}"
# Set variable to better handle terminal commands
ENV TERM xterm

# Necessary to execute tomcat and custom scripts
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["catalina.sh", "run"]
EXPOSE 8080
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# 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}"
# Regex is needed in jetty9 images, but not alpine's ones.
run-parts -v "${CUSTOM_SCRIPTS_DIRECTORY}" --regex='.*'
echo "[INFO] End executing custom scripts"
fi
11 changes: 11 additions & 0 deletions georchestra-docker-scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

DIR=/docker-entrypoint.d

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 "$@"
Loading