-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/add-mdm-explorer' into develop
- Loading branch information
Showing
4 changed files
with
44 additions
and
1 deletion.
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
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 |
---|---|---|
|
@@ -10,6 +10,12 @@ ARG MDM_UI_COMMIT=main | |
ARG ADDITIONAL_PLUGINS="" | ||
ARG MDM_UI_THEME_NAME="default" | ||
ARG MDM_UI_FEATURE_SUBSCRIBED_CATALOGUES="true" | ||
|
||
ARG DEPLOY_MDM_EXPLORER=0 | ||
ARG MDM_EXPLORER_VERSION="1.0.0-SNAPSHOT" | ||
ARG MDM_EXPLORER_BUILD_HOME=/opt/mdm-explorer/dist | ||
ARG MDM_EXPLORER_API_ENDPOINT="http://localhost:${MDM_PORT}/api" | ||
|
||
# This is needed to ensure the fetch and checkout are always run | ||
# If the arg is passed in using a random value then it will invalidate the docker cache and force the following steps to re-run | ||
ARG CACHE_BURST=1 | ||
|
@@ -21,6 +27,13 @@ ARG CACHE_BURST=1 | |
# Checkout the desired versions | ||
RUN cd "$MDM_APPLICATION_HOME" && git fetch && git checkout "$MDM_APPLICATION_COMMIT" && if [[ `git status` != HEAD\ detached* ]]; then git pull; fi | ||
RUN cd "$MDM_UI_HOME" && git fetch && git checkout "$MDM_UI_COMMIT" && if [[ `git status` != HEAD\ detached* ]]; then git pull; fi | ||
RUN mkdir -p $MDM_EXPLORER_BUILD_HOME | ||
|
||
# Copy in the building scripts | ||
COPY build_scripts /usr/local/bin/ | ||
|
||
# Make sure all scripts are executable | ||
RUN chmod a+x /usr/local/bin/* | ||
|
||
# Copy in build.yml | ||
COPY config/build.yml $MDM_APPLICATION_HOME/grails-app/conf/build.yml | ||
|
@@ -31,6 +44,7 @@ COPY mdm-ui $MDM_UI_HOME/ | |
# Build the front and back ends | ||
# The front end build will try to use precompiled sources or it will build locally from the given commit/tagU | ||
RUN build_frontend.sh | ||
RUN build_explorer.sh | ||
|
||
# The only way to include plugins is to build the API manually, however this actually takes very little time as we already have all the | ||
# dependencies downloaded | ||
|
@@ -48,7 +62,9 @@ FROM maurodatamapper/tomcat:$TOMCAT_IMAGE_VERSION | |
LABEL maintainer="Oliver Freeman <[email protected]>" | ||
|
||
ARG MDM_BUILD_HOME=/opt/mdm | ||
ARG MDM_EXPLORER_BUILD_HOME=/opt/mdm-explorer/dist | ||
|
||
ENV CATALINA_OPTS="-Xmx8g -Xms512m -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+UseCompressedOops" | ||
|
||
COPY --from=mdm-build ${MDM_BUILD_HOME} ${CATALINA_HOME}/webapps/ROOT | ||
COPY --from=mdm-build ${MDM_EXPLORER_BUILD_HOME} ${CATALINA_HOME}/webapps/explorer |
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,26 @@ | ||
#!/bin/bash | ||
|
||
precompiledBuild(){ | ||
echo 'Using pre-compiled source' | ||
|
||
if [[ $MDM_EXPLORER_VERSION == *SNAPSHOT ]] | ||
then | ||
MDM_EXPLORER_LIBRARY='artifacts-snapshots' | ||
else | ||
MDM_EXPLORER_LIBRARY='artifacts' | ||
fi | ||
|
||
MDM_EXPLORER_URL="http://jenkins.cs.ox.ac.uk/artifactory/${MDM_EXPLORER_LIBRARY}/mauroDataMapper/mdm-explorer/mdm-explorer-${MDM_EXPLORER_VERSION}.tgz" | ||
|
||
echo "Downloading precompiled sources ${MDM_EXPLORER_URL}" | ||
|
||
cd /opt || exit | ||
curl -LO "$MDM_EXPLORER_URL" | ||
tar xzf "mdm-explorer-${MDM_EXPLORER_VERSION}.tgz" | ||
mkdir "$MDM_EXPLORER_BUILD_HOME" | ||
cp -r "mdm-explorer-${MDM_EXPLORER_VERSION}"/* "$MDM_EXPLORER_BUILD_HOME" | ||
|
||
find "$MDM_EXPLORER_BUILD_HOME" -name main.*.js -exec sed -e "s|apiEndpoint:\"api\",|apiEndpoint:\"${MDM_EXPLORER_API_ENDPOINT}\",|g" -i {} \; | ||
} | ||
|
||
precompiledBuild |
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