From 3336e0594535e377d069055388bccfdaaf94f196 Mon Sep 17 00:00:00 2001 From: abessiari Date: Wed, 15 Apr 2020 09:05:05 -0700 Subject: [PATCH 1/5] Docker deployment for Separate Solr Service Co-author No longer supports embedded solr in Metacat<2.13.0 Adds ESS-DIVE custom skins to image + These were ported from ess-dive-catalog. This + saves the extra step of deployments + Metacat waits for solr to startup Supports Issue ess-dive/ess-dive-project#99 --- .gitignore | 7 +- build.sh | 98 +++-- Dockerfile => metacat/Dockerfile | 22 +- apply_config.py => metacat/apply_config.py | 0 apply_context.py => metacat/apply_context.py | 0 .../catalina.properties | 0 .../docker-entrypoint.sh | 42 +-- image-server.xml => metacat/image-server.xml | 0 metacat.conf => metacat/metacat.conf | 0 server.xml => metacat/server.xml | 0 server.xml.patch => metacat/server.xml.patch | 0 metacat/skins/json-ld/eml2jsonld.xsl | 293 +++++++++++++++ metacat/skins/json-ld/json-ld.properties | 11 + metacat/skins/json-ld/json-ld.xml | 21 ++ metacat/skins/osti/eml2osti.xsl | 339 ++++++++++++++++++ metacat/skins/osti/osti.xml | 21 ++ solr/.gitignore | 5 + solr/Dockerfile | 5 + solr/README.md | 3 + solr/configure_metacat_solrcore.sh | 19 + 20 files changed, 818 insertions(+), 68 deletions(-) rename Dockerfile => metacat/Dockerfile (76%) rename apply_config.py => metacat/apply_config.py (100%) rename apply_context.py => metacat/apply_context.py (100%) rename catalina.properties => metacat/catalina.properties (100%) rename docker-entrypoint.sh => metacat/docker-entrypoint.sh (92%) rename image-server.xml => metacat/image-server.xml (100%) rename metacat.conf => metacat/metacat.conf (100%) rename server.xml => metacat/server.xml (100%) rename server.xml.patch => metacat/server.xml.patch (100%) create mode 100644 metacat/skins/json-ld/eml2jsonld.xsl create mode 100644 metacat/skins/json-ld/json-ld.properties create mode 100644 metacat/skins/json-ld/json-ld.xml create mode 100644 metacat/skins/osti/eml2osti.xsl create mode 100644 metacat/skins/osti/osti.xml create mode 100644 solr/.gitignore create mode 100644 solr/Dockerfile create mode 100644 solr/README.md create mode 100644 solr/configure_metacat_solrcore.sh diff --git a/.gitignore b/.gitignore index fc090f8..f4b3b5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -.idea/ +*.tar.gz +*.war +.DS_Store image_version.yml -metacat-bin-*.tar.gz -metacat*.properties -test.properties diff --git a/build.sh b/build.sh index a6af06f..99610be 100755 --- a/build.sh +++ b/build.sh @@ -29,42 +29,88 @@ then fi -VERSION=$1 + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +#Read the split words into an array based on space delimiter +VERSION=$1 +IFS='.' read -a version_array <<< "${VERSION}" -# Get Metacat -METACAT=metacat-bin-${VERSION} -ARCHIVE=${METACAT}.tar.gz +if [ ${#version_array[*]} -lt 3 ]; +then + echo "ERROR: Version ${VERSION} must be three numbers it is ${#version_array[*]}" + exit +fi +version_major=${version_array[0]} +version_minor=${version_array[1]} +echo "INFO: Metacat major:$version_major minor:$version_minor" -BUILD_ARGS="${BUILD_ARGS} --build-arg METACAT_VERSION=${VERSION}" -if [ ! -f $DIR/${ARCHIVE} ]; +# Check the version number +# Continue if form Metacat 2.13 and greater +if [ $version_major -eq 2 ] && [ $version_minor -ge 13 ] || [ $version_major -ge 3 ]; then - wget http://knb.ecoinformatics.org/software/dist/${ARCHIVE} -O $DIR/${ARCHIVE} -fi + # Get Metacat + METACAT=metacat-bin-${VERSION} + ARCHIVE=${METACAT}.tar.gz -# create the docker tag -DOCKER_TAG="${VERSION}-p$(cd $DIR; git rev-list HEAD --count)" + BUILD_ARGS="${BUILD_ARGS} --build-arg METACAT_VERSION=${VERSION}" -# CREATE image_version.yml -echo "****************************" -echo "BUILDING image_version" -echo "****************************" -IMAGE_VERSION_CONTENT="$(cd $DIR && git log -n 1 --pretty="commit_count: $(git rev-list HEAD --count)%ncommit_hash: %h%nsubject: %s%ncommitter: %cN <%ce>%ncommiter_date: %ci%nauthor: %aN <%ae>%nauthor_date: %ai%nref_names: %D" )" -echo "$IMAGE_VERSION_CONTENT" > $DIR/image_version.yml -cat $DIR/image_version.yml + # Get the metacat distribution + if [ ! -f "$DIR/${ARCHIVE}" ]; + then + wget http://knb.ecoinformatics.org/software/dist/${ARCHIVE} -O $DIR/${ARCHIVE} + fi + + # create the docker tag + DOCKER_TAG="${VERSION}-p$(cd $DIR; git rev-list HEAD --count)" + + # CREATE image_version.yml + echo "****************************" + echo "BUILDING image_version" + echo "****************************" + IMAGE_VERSION_CONTENT="$(cd $DIR && git log -n 1 --pretty="commit_count: $(git rev-list HEAD --count)%ncommit_hash: %h%nsubject: %s%ncommitter: %cN <%ce>%ncommiter_date: %ci%nauthor: %aN <%ae>%nauthor_date: %ai%nref_names: %D" )" + echo "$IMAGE_VERSION_CONTENT" > $DIR/image_version.yml + cat $DIR/image_version.yml + + + # Determine if there is an image registry + IMAGE_NAME="metacat:${DOCKER_TAG}" + if [ "${REGISTRY_SPIN}" != "" ]; + then + # There is a spin registry + IMAGE_NAME="${REGISTRY_SPIN}/${IMAGE_NAME}" + fi + + echo "docker build ${DOCKER_BUILD_OPTIONS} -f $DIR/metacat/Dockerfile -t ${IMAGE_NAME} $BUILD_ARGS $DIR/" + docker build ${DOCKER_BUILD_OPTIONS} -f $DIR/metacat/Dockerfile -t ${IMAGE_NAME} $BUILD_ARGS $DIR/ + + + rm -rf $DIR/metacat-index.war $DIR/solr/WEB-INF + + # Get the solr config from the index war file for solr image + tar -xvf $DIR/${ARCHIVE} --directory $DIR metacat-index.war + unzip "$DIR/metacat-index.war" "WEB-INF/classes/solr-home/conf/*" -d "$DIR/solr" + + # create the docker tag + DOCKER_TAG="${VERSION}-8.4.1-p$(cd $DIR; git rev-list HEAD --count)" + + # Determine if there is an image registry + IMAGE_NAME="metacat-solr:${DOCKER_TAG}" + if [ "${REGISTRY_SPIN}" != "" ]; + then + # There is a spin registry + IMAGE_NAME="${REGISTRY_SPIN}/${IMAGE_NAME}" + fi + + echo "docker build ${DOCKER_BUILD_OPTIONS} -f $DIR/solr/Dockerfile -t ${IMAGE_NAME} $BUILD_ARGS $DIR/" + docker pull solr:8.4.1 + docker build ${DOCKER_BUILD_OPTIONS} -f $DIR/solr/Dockerfile -t ${IMAGE_NAME} $BUILD_ARGS $DIR/ +else + + echo "ERROR: Metacat Version $VERSION not supported anymore. Please use Metacat>=2.13.0" -# Determine if there is an image registry -IMAGE_NAME="metacat:${DOCKER_TAG}" -if [ "${REGISTRY_SPIN}" != "" ]; -then - # There is a spin registry - IMAGE_NAME="${REGISTRY_SPIN}/${IMAGE_NAME}" fi -echo "docker build --no-cache -t ${IMAGE_NAME} $BUILD_ARGS $DIR" -docker pull tomcat:7.0-jre8 -docker build ${DOCKER_BUILD_OPTIONS} -t ${IMAGE_NAME} $BUILD_ARGS $DIR \ No newline at end of file diff --git a/Dockerfile b/metacat/Dockerfile similarity index 76% rename from Dockerfile rename to metacat/Dockerfile index 199bbd9..07fdf18 100644 --- a/Dockerfile +++ b/metacat/Dockerfile @@ -7,10 +7,15 @@ ARG METACAT_UID=108 ARG METACAT_GID=121 ENV METACAT_APP_CONTEXT=metacat +ENV DB_HOST=db +ENV DB_PORT=5432 +ENV DB_SOLR_HOST=db-solr +ENV DB_SOLR_PORT=8983 ARG METACAT_VERSION=2.8.7 -ADD /metacat-bin-${METACAT_VERSION}.tar.gz /tmp/ -ADD catalina.properties /tmp/ -ADD server.xml.patch /tmp/ +ADD metacat-bin-${METACAT_VERSION}.tar.gz /tmp/ +ADD metacat/catalina.properties /tmp/ +ADD metacat/server.xml.patch /tmp/ +ADD metacat/skins /tmp/skins ADD image_version.yml image_version.yml @@ -28,15 +33,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && cp /tmp/metacat.war /tmp/metacat-index.war /usr/local/tomcat/webapps \ && cat /tmp/catalina.properties >> /usr/local/tomcat/conf/catalina.properties -ADD metacat.conf /etc/logrotate.d/ +ADD metacat/metacat.conf /etc/logrotate.d/ -COPY apply_config.py /usr/local/bin/ +COPY metacat/apply_config.py /usr/local/bin/ RUN ln -s usr/local/bin/apply_config.py / # backwards compat -COPY apply_context.py /usr/local/bin/ +COPY metacat/apply_context.py /usr/local/bin/ RUN ln -s usr/local/bin/apply_context.py / # backwards compat -COPY docker-entrypoint.sh /usr/local/bin/ +COPY metacat/docker-entrypoint.sh /usr/local/bin/ RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat ENTRYPOINT ["docker-entrypoint.sh"] @@ -47,8 +52,7 @@ RUN patch conf/server.xml /tmp/server.xml.patch RUN groupadd -g ${METACAT_GID} metacat && \ useradd -u ${METACAT_UID} -g ${METACAT_GID} -c 'Metacat User' --no-create-home metacat && \ mkdir -p /var/metacat && \ - mkdir -p /var/metacat-fast && \ - chown -R metacat:metacat /var/metacat /var/metacat-fast logs temp work && \ + chown -R metacat:metacat /var/metacat logs temp work && \ chown -R metacat:metacat /usr/local/tomcat/conf && \ chown metacat:metacat /usr/local/tomcat/webapps && \ chmod g+s /usr/local/tomcat/webapps && \ diff --git a/apply_config.py b/metacat/apply_config.py similarity index 100% rename from apply_config.py rename to metacat/apply_config.py diff --git a/apply_context.py b/metacat/apply_context.py similarity index 100% rename from apply_context.py rename to metacat/apply_context.py diff --git a/catalina.properties b/metacat/catalina.properties similarity index 100% rename from catalina.properties rename to metacat/catalina.properties diff --git a/docker-entrypoint.sh b/metacat/docker-entrypoint.sh similarity index 92% rename from docker-entrypoint.sh rename to metacat/docker-entrypoint.sh index 489448a..75daa48 100755 --- a/docker-entrypoint.sh +++ b/metacat/docker-entrypoint.sh @@ -18,6 +18,15 @@ if [ "$1" = 'bin/catalina.sh' ]; then sleep 0.1 done + echo + echo '**************************************' + echo "Waiting for Solr to start " + echo '**************************************' + echo + while ! nc -z "${DB_SOLR_HOST:-db-solr}" "${DB_SOLR_PORT:-8983}"; do + sleep 0.1 + done + echo echo '**************************************' echo "Logrotating catalina.out" @@ -61,7 +70,7 @@ if [ "$1" = 'bin/catalina.sh' ]; then DEFAULT_PROPERTIES_FILE=${METACAT_DIR}/WEB-INF/metacat.properties APP_PROPERTIES_FILE=${APP_PROPERTIES_FILE:-/config/app.properties} - METACATUI_CUSTOM_SKINS_PATH=/config/skins + METACATUI_CUSTOM_SKINS_PATH=/tmp/skins METACAT_VERSION_CONFIGURED=`grep application.metacatVersion $DEFAULT_PROPERTIES_FILE | sed 's/[^:]*=//'` @@ -142,13 +151,13 @@ if [ "$1" = 'bin/catalina.sh' ]; then # Make sure all default directories are available and owned by metacat [ `stat -c '%U:%G' /var/metacat` = 'metacat:metacat' ] || chown metacat:metacat /var/metacat - [ `stat -c '%U:%G' /var/metacat-fast` = 'metacat:metacat' ] || chown metacat:metacat /var/metacat-fast mkdir -p /var/metacat/data \ /var/metacat/inline-data \ /var/metacat/documents \ /var/metacat/temporary \ - /var/metacat/logs + /var/metacat/logs \ + /var/metacat/solr-temp # Look for Tomcat Configuration to copy if [ -d /config/conf ]; @@ -160,32 +169,7 @@ if [ "$1" = 'bin/catalina.sh' ]; then done fi - - # Initialize the solr home directory - SOLR_CONF_LOCATION=/var/metacat-fast/solr-home - if [ ! -d ${SOLR_CONF_LOCATION} ]; - then - - # Setup env for Here Document - SOLR_CONF_DEFAULT_LOCATION=/usr/local/tomcat/webapps/metacat-index/WEB-INF/classes/solr-home - USER_PWFILE="/var/metacat/users/password.xml" - SOLR_CONF_FILES=`bash -c "cd ${SOLR_CONF_DEFAULT_LOCATION} && find ."` - - echo "INFO SOLR_CONF_LOCATION ${SOLR_CONF_LOCATION}" - bash -c "mkdir -p $SOLR_CONF_LOCATION" - - for SOLR_FILE in ${SOLR_CONF_FILES[@]} - do - NEW_DIR=$(dirname $SOLR_CONF_LOCATION/$SOLR_FILE) - - mkdir -p $NEW_DIR - if [ -f $SOLR_CONF_DEFAULT_LOCATION/$SOLR_FILE ] && [ ! -f $SOLR_CONF_LOCATION/$SOLR_FILE ]; - then - echo "cp ${SOLR_CONF_DEFAULT_LOCATION}/$SOLR_FILE $SOLR_CONF_LOCATION/$SOLR_FILE" - cp ${SOLR_CONF_DEFAULT_LOCATION}/$SOLR_FILE $SOLR_CONF_LOCATION/$SOLR_FILE - fi - done - fi + USER_PWFILE="/var/metacat/users/password.xml" # If there is an admin/password set and it does not exist in the passwords file # set it diff --git a/image-server.xml b/metacat/image-server.xml similarity index 100% rename from image-server.xml rename to metacat/image-server.xml diff --git a/metacat.conf b/metacat/metacat.conf similarity index 100% rename from metacat.conf rename to metacat/metacat.conf diff --git a/server.xml b/metacat/server.xml similarity index 100% rename from server.xml rename to metacat/server.xml diff --git a/server.xml.patch b/metacat/server.xml.patch similarity index 100% rename from server.xml.patch rename to metacat/server.xml.patch diff --git a/metacat/skins/json-ld/eml2jsonld.xsl b/metacat/skins/json-ld/eml2jsonld.xsl new file mode 100644 index 0000000..41b0d03 --- /dev/null +++ b/metacat/skins/json-ld/eml2jsonld.xsl @@ -0,0 +1,293 @@ + + + + + ' + + + + + + + + + + + + + + + + + + + + { + "@context": "http://schema.org/", + "url": "", + "@type": "Dataset", + "@id": "", + "name": "", + "includedInDataCatalog": { "name": "", + "url": "", + "identifier": ""}, + "description": + [ + + "" + , + + + ], + + "alternateName": [ + + "" + + , + + + ], + + "creator": [ + { + "@type": "Person", + + "@id": "", + + "name": " ", + "givenName":"", + "familyName":"" + + , + + + "affiliation":"" + + , + + + "email":"" + } + + , + + + ], + + "contributor": [ + { + "@type": "Person", + + "@id": "", + + "name": " ", + "givenName":"", + "familyName":"" + + , + + + "affiliation":"" + + , + + + "email":"" + } + + , + + + ], + + "datePublished": "", + "keywords": [ + + + "" + + , + + + + , + + + ] + + ,"variableMeasured": [ + + + "" + + , + + + + , + + + ] + + + + + ,"license": "http://creativecommons.org/licenses/by/4.0/" + + + ,"license": "http://creativecommons.org/publicdomain/zero/1.0/" + + + + + ,"spatialCoverage": [ + + { + "@type": "Place", + + "description": "", + + + "geo": [ + { + "@type": "GeoCoordinates", + "name": "Northwest", + "latitude": , + "longitude": + }, + { + "@type": "GeoCoordinates", + "name": "Southeast", + "latitude": , + "longitude": + } + ] + + } + , + + + ] + + + ,"award": [ + + "" + + , + + + ] + + + ,"funder": [ + + { + "@type": "Organization", + + "@id": "", + + "name": "" + } + + , + + + ] + + + ,"temporalCoverage": + [ + + "/.." + + , + + + ] + + + "/.." + + + + + ,"editor": { + "@type": "Person", + "@id": "", + + "name": " ", + "givenName": " ", + "familyName": "" + , + + + "affiliation": "" + , + + + "email": "" + } + + + ,"citation": [ + + "" + + , + + + + ] + + + ,"provider": { + "@type": "Organization", + "name": "", + "member": + { + "@type": "Person", + "@id": "", + "name": " ", + "givenName": "", + "familyName": "", + "jobTitle": "" + , + + "affiliation": "" + , + + + "email": "" + } + } + + + ,"measurementTechnique": [ + + "" + , + + + ] + + + ,"distribution": [ + + {"name":"", + "encodingFormat":""} + + , + + + ] + + } + + + + + + + diff --git a/metacat/skins/json-ld/json-ld.properties b/metacat/skins/json-ld/json-ld.properties new file mode 100644 index 0000000..2777fad --- /dev/null +++ b/metacat/skins/json-ld/json-ld.properties @@ -0,0 +1,11 @@ +# parameters (name/value pairs) will be passed to the style sheets +# the value can be either a name of metacat properties (e.g. server.name) or a real value (e.g. ESS-DIVE). + +stylesheet.parameters.1.name=serverName +stylesheet.parameters.1.value=server.name +stylesheet.parameters.2.name=catalogName +stylesheet.parameters.2.value=ESS-DIVE +stylesheet.parameters.3.name=catalogId +sytlesheet.parameters.3.value=https://doi.org/10.25504/FAIRsharing.d6Pe1f +stylesheet.parameters.4.name=sentinal +stylesheet.parameters.4.value=stop \ No newline at end of file diff --git a/metacat/skins/json-ld/json-ld.xml b/metacat/skins/json-ld/json-ld.xml new file mode 100644 index 0000000..35d3e57 --- /dev/null +++ b/metacat/skins/json-ld/json-ld.xml @@ -0,0 +1,21 @@ + + + + /style/common/ascii-treeview.xsl + + /style/skins/json-ld/eml2jsonld.xsl + + + /style/skins/json-ld/eml2jsonld.xsl + + + /style/skins/json-ld/eml2jsonld.xsl + + + /style/skins/json-ld/eml2jsonld.xsl + + + /style/skins/json-ld/eml2jsonld.xsl + + + \ No newline at end of file diff --git a/metacat/skins/osti/eml2osti.xsl b/metacat/skins/osti/eml2osti.xsl new file mode 100644 index 0000000..693d5ad --- /dev/null +++ b/metacat/skins/osti/eml2osti.xsl @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + <xsl:value-of select="title"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metacat/skins/osti/osti.xml b/metacat/skins/osti/osti.xml new file mode 100644 index 0000000..a1259b4 --- /dev/null +++ b/metacat/skins/osti/osti.xml @@ -0,0 +1,21 @@ + + + + /style/common/ascii-treeview.xsl + + /style/skins/osti/eml2osti.xsl + + + /style/skins/osti/eml2osti.xsl + + + /style/skins/osti/eml2osti.xsl + + + /style/skins/osti/eml2osti.xsl + + + /style/skins/osti/eml2osti.xsl + + + \ No newline at end of file diff --git a/solr/.gitignore b/solr/.gitignore new file mode 100644 index 0000000..5f3d98a --- /dev/null +++ b/solr/.gitignore @@ -0,0 +1,5 @@ +.idea/ +conf/ +image_version.yml +metacat-bin-*.tar.gz +metacat*.properties diff --git a/solr/Dockerfile b/solr/Dockerfile new file mode 100644 index 0000000..a969263 --- /dev/null +++ b/solr/Dockerfile @@ -0,0 +1,5 @@ +FROM solr:8.4.1 + +ADD image_version.yml image_version.yml +ADD solr/WEB-INF/classes/solr-home/conf /tmp/conf +ADD solr/configure_metacat_solrcore.sh /docker-entrypoint-initdb.d diff --git a/solr/README.md b/solr/README.md new file mode 100644 index 0000000..018a5ae --- /dev/null +++ b/solr/README.md @@ -0,0 +1,3 @@ +# docker-metacat-solr + +Solr instance with built-in metacat schema and solr config. diff --git a/solr/configure_metacat_solrcore.sh b/solr/configure_metacat_solrcore.sh new file mode 100644 index 0000000..3d0086e --- /dev/null +++ b/solr/configure_metacat_solrcore.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + + # Prepare index + if [ ! -d ${SOLR_HOME}/dataone/conf ]; + then + echo "INFO Configuring metacat solr core ..." + + # Create a solr core + precreate-core dataone + + # Copy Metacat dataone conf to the newly created + # dataone solr core + cp -rv /tmp/conf $SOLR_HOME/dataone/ + + echo "Metacat solr index prepared" +else + echo "INFO Solr core already configured." +fi \ No newline at end of file From 0d7682bea3b8642dc6bce9f91d5a50cbce34bec8 Mon Sep 17 00:00:00 2001 From: Val Hendrix Date: Wed, 7 Jul 2021 07:39:42 -0700 Subject: [PATCH 2/5] Upgrades solr to 8.8.2 This will address security vulnerabilities in 8.4 Closes #25 --- solr/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/Dockerfile b/solr/Dockerfile index a969263..a13f33f 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -1,4 +1,4 @@ -FROM solr:8.4.1 +FROM solr:8.8.2 ADD image_version.yml image_version.yml ADD solr/WEB-INF/classes/solr-home/conf /tmp/conf From f2e4adcb86465462306e0c54a04abdf1cc7d40c6 Mon Sep 17 00:00:00 2001 From: Val Hendrix Date: Fri, 16 Jul 2021 14:07:00 -0700 Subject: [PATCH 3/5] Bump up Solr version to latest (8.9) --- solr/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/Dockerfile b/solr/Dockerfile index a13f33f..95c417a 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -1,4 +1,4 @@ -FROM solr:8.8.2 +FROM solr:8.9 ADD image_version.yml image_version.yml ADD solr/WEB-INF/classes/solr-home/conf /tmp/conf From 5177be9f8f0f8d1fc396ab96473c409a3f43cf51 Mon Sep 17 00:00:00 2001 From: Val Hendrix Date: Fri, 16 Jul 2021 14:08:01 -0700 Subject: [PATCH 4/5] Add PID to otherEntity in EML Support Issue ess-dive/essdive-package-service#216 --- metacat/skins/json-ld/eml2jsonld.xsl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/metacat/skins/json-ld/eml2jsonld.xsl b/metacat/skins/json-ld/eml2jsonld.xsl index 41b0d03..d9c0d07 100644 --- a/metacat/skins/json-ld/eml2jsonld.xsl +++ b/metacat/skins/json-ld/eml2jsonld.xsl @@ -276,7 +276,9 @@ ,"distribution": [ {"name":"", - "encodingFormat":""} + "encodingFormat":"", + "identifier": "" + } , From 5b1bf2026b161c1e0c823cb098af94d3eabc09c7 Mon Sep 17 00:00:00 2001 From: Val Hendrix Date: Tue, 20 Jul 2021 08:55:09 -0700 Subject: [PATCH 5/5] Adds SOLR_VERSION as a build arg This paramterizes SOLR_VERSION and make sure it is reflected in the docker image name --- build.sh | 6 ++++-- solr/Dockerfile | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 99610be..623a923 100755 --- a/build.sh +++ b/build.sh @@ -6,6 +6,8 @@ if [ -z $1 ] ; echo "Usage: $0 ( )" exit fi +SOLR_VERSION=8.9 +BUILD_ARGS="${BUILD_ARGS} --build-arg SOLR_VERSION=$SOLR_VERSION" BUILD_ARGS="" if [ ! -z $2 ] ; @@ -95,7 +97,7 @@ then unzip "$DIR/metacat-index.war" "WEB-INF/classes/solr-home/conf/*" -d "$DIR/solr" # create the docker tag - DOCKER_TAG="${VERSION}-8.4.1-p$(cd $DIR; git rev-list HEAD --count)" + DOCKER_TAG="${VERSION}-${SOLR_VERSION}-p$(cd $DIR; git rev-list HEAD --count)" # Determine if there is an image registry IMAGE_NAME="metacat-solr:${DOCKER_TAG}" @@ -106,7 +108,7 @@ then fi echo "docker build ${DOCKER_BUILD_OPTIONS} -f $DIR/solr/Dockerfile -t ${IMAGE_NAME} $BUILD_ARGS $DIR/" - docker pull solr:8.4.1 + docker pull solr:${SOLR_VERSION} docker build ${DOCKER_BUILD_OPTIONS} -f $DIR/solr/Dockerfile -t ${IMAGE_NAME} $BUILD_ARGS $DIR/ else diff --git a/solr/Dockerfile b/solr/Dockerfile index 95c417a..dc18839 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -1,4 +1,5 @@ -FROM solr:8.9 +ARG SOLR_VERSION=8.4.1 +FROM solr:${SOLR_VERSION} ADD image_version.yml image_version.yml ADD solr/WEB-INF/classes/solr-home/conf /tmp/conf