diff --git a/.env b/.env index 994229b..46b8c58 100644 --- a/.env +++ b/.env @@ -8,11 +8,11 @@ # 1. a tagged release e.g. 4.10.0 # 2. a branch e.g. main or develop # 3. a git commit hash -MDM_APPLICATION_COMMIT=5.1.0 -MDM_UI_COMMIT=7.1.0 +MDM_APPLICATION_COMMIT=5.2.0 +MDM_UI_COMMIT=7.2.0 # Change this to alter the port MDM is published to MDM_PORT=8082 # Change this to change the tag assigned to the built docker mdm image -MDM_TAG=2022.2 +MDM_TAG=2022.3 diff --git a/docker-compose.yml b/docker-compose.yml index 1a484d7..0025d8e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,7 @@ services: ADDITIONAL_PLUGINS: "" MDM_UI_THEME_NAME: "default" CACHE_BURST: "${CACHE_BURST}" + MDM_EXPLORER_API_ENDPOINT: "http://localhost:${MDM_PORT}/api" environment: PGPASSWORD: postgresisawesome runtime.config.path: /usr/local/tomcat/conf/runtime.yml diff --git a/mauro-data-mapper/Dockerfile b/mauro-data-mapper/Dockerfile index dd40b6a..f340704 100644 --- a/mauro-data-mapper/Dockerfile +++ b/mauro-data-mapper/Dockerfile @@ -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 " 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 diff --git a/mauro-data-mapper/build_scripts/build_explorer.sh b/mauro-data-mapper/build_scripts/build_explorer.sh new file mode 100755 index 0000000..5a49322 --- /dev/null +++ b/mauro-data-mapper/build_scripts/build_explorer.sh @@ -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 \ No newline at end of file diff --git a/postgres/Dockerfile b/postgres/Dockerfile index 51cce9f..cd370d7 100644 --- a/postgres/Dockerfile +++ b/postgres/Dockerfile @@ -1,4 +1,4 @@ -FROM postgres:12.0-alpine +FROM postgres:12.10-alpine COPY fixtures /docker-entrypoint-initdb.d ENV POSTGRES_PASSWORD=postgresisawesome \ diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..f45d8f1 --- /dev/null +++ b/renovate.json @@ -0,0 +1,5 @@ +{ + "extends": [ + "config:base" + ] +}