Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  remove failOnWarning for analyze-only, not relevant here
  ignore warning for unused declared dependency pica2mods-xslt
  remove runtime scope of pica2mods, additional libs are needed
  MCR-2896 - use xalan parser for MCRFoFormatterFOP
  add missing coreFunctions to structure editor view
  UBO-247 Indicate which service found a search result in the identity picker (#290)
  readd coreFunctions for response
  refacture coreFunctions
  UBO-248 add root element modsCollection (#293)
  fix core function includes
  UBO-245 Allow subject/destatis to be retrieved alternatively from origin (#288)
  UBO-246 Added support for importing list of doi (#289)
  UBO-244 Publication status restriction in solr query in rsc/export/link/{format}/{pids:.+} should be configurable (#286)
  Update branch name in docker-compose.prod.yml
  Added dockerfiles and adopted workflows to build images
  UBO-200 encode colons in solr uri (#285)
  UBO-242 response-sidebar-mini.xsl/response-newest.xsl takes actual query in to account fo… (#282)
  UBO-241 Add count from LocalService to count from LDAPService (#281)
  UBO-227 Provide html anchor to cancel button
  UBO-238 User profile displays linked publications regardless of state (#278)
  UBO-200 Migrate to Java 17 and MyCoRe 2022.6.x (#279)
  • Loading branch information
kkrebs committed Jun 15, 2023
2 parents ba69796 + 0f184ed commit 2c42c08
Show file tree
Hide file tree
Showing 78 changed files with 934 additions and 284 deletions.
21 changes: 21 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
NAME=ubo

DB_PORT=8293
DB_USER=pguser
DB_PASSWORD=password
DB_DATA=./docker/postgres-data/

APP_CONTEXT=ubo
APP_HTTP=8291
APP_AJP=8292
APP_DEBUG=8295
APP_HOME=./docker/ubo-home/
APP_DATA=./docker/ubo-data/
APP_LOGS=./docker/ubo-logs/
APP_TMP=./docker/ubo-tmp/

APP_XMS=1024m
APP_XMX=1024m

SOLR_HTTP=8290
SOLR_DATA=./docker/solr-data/
6 changes: 3 additions & 3 deletions .github/workflows/maven-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
java-version: '17'
distribution: 'adopt'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build with Maven
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/maven-publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
java-version: '17'
distribution: 'adopt'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
Expand All @@ -31,3 +31,16 @@ jobs:
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
- name: Login to Docker Hub
if: success()
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the mir Docker images and push them
if: success()
run: |
docker build . --file Dockerfile --tag mycoreorg/ubo:${GITHUB_REF_NAME}
docker build ubo-webapp/src/main/setup/solr/ --file ubo-webapp/src/main/setup/solr/Dockerfile --tag mycoreorg/ubo-solr:${GITHUB_REF_NAME}
docker push mycoreorg/ubo:${GITHUB_REF_NAME}
docker push mycoreorg/ubo-solr:${GITHUB_REF_NAME}
19 changes: 16 additions & 3 deletions .github/workflows/maven-publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
java-version: '17'
distribution: 'adopt'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
Expand All @@ -32,3 +32,16 @@ jobs:
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
- name: Login to Docker Hub
if: success()
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the mir Docker images and push them
if: success()
run: |
docker build . --file Dockerfile --tag mycoreorg/ubo:${GITHUB_REF_NAME}
docker build ubo-webapp/src/main/setup/solr/ --file ubo-webapp/src/main/setup/solr/Dockerfile --tag mycoreorg/ubo-solr:${GITHUB_REF_NAME}
docker push mycoreorg/ubo:${GITHUB_REF_NAME}
docker push mycoreorg/ubo-solr:${GITHUB_REF_NAME}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
*.iml
pom.xml.bak
*/target/
.DS_Store
.DS_Store
/docker/
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM tomcat:jdk17-temurin-focal
RUN groupadd -r mcr -g 501 && \
useradd -d /home/mcr -u 501 -m -s /bin/bash -g mcr mcr
WORKDIR /usr/local/tomcat/
ARG PACKET_SIZE="65536"
ENV APP_CONTEXT="ubo" \
MCR_CONFIG_DIR="/mcr/home/" \
MCR_DATA_DIR="/mcr/data/" \
MCR_LOG_DIR="/mcr/logs/" \
SOLR_CORE="ubo" \
SOLR_CLASSIFICATION_CORE="ubo-classifications" \
XMX="1g" \
XMS="1g"
COPY --from=regreb/bibutils --chown=mcr:mcr /usr/local/bin/* /usr/local/bin/
COPY --chown=root:root docker-entrypoint.sh /usr/local/bin/ubo.sh

RUN set -eux; \
chmod 555 /usr/local/bin/ubo.sh; \
apt-get update; \
apt-get install -y gosu; \
rm -rf /var/lib/apt/lists/*;
RUN rm -rf /usr/local/tomcat/webapps/* && \
mkdir /opt/ubo/ && \
chown mcr:mcr -R /opt/ubo/ && \
sed -ri "s/<\/Service>/<Connector protocol=\"AJP\/1.3\" packetSize=\"$PACKET_SIZE\" tomcatAuthentication=\"false\" scheme=\"https\" secretRequired=\"false\" allowedRequestAttributesPattern=\".*\" encodedSolidusHandling=\"decode\" address=\"0.0.0.0\" port=\"8009\" redirectPort=\"8443\" \/>&/g" /usr/local/tomcat/conf/server.xml
COPY --chown=mcr:mcr ubo-webapp/target/ubo-*.war /opt/ubo/ubo.war
COPY --chown=mcr:mcr ubo-cli /opt/ubo/ubo-cli
COPY --chown=mcr:mcr docker-log4j2.xml /opt/ubo/log4j2.xml
RUN chown mcr:mcr -R /opt/ubo/ /usr/local/tomcat/webapps/
CMD ["bash", "/usr/local/bin/ubo.sh"]
49 changes: 49 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
version: '3.1'

services:
db:
container_name: ${NAME}-db
image: postgres:12
restart: unless-stopped
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=ubo
volumes:
- ${DB_DATA}:/var/lib/postgresql/data/
ports:
- ${DB_PORT}:5432
solr:
container_name: ${NAME}-solr
image: mycoreorg/ubo-solr:develop
restart: unless-stopped
volumes:
- ${SOLR_DATA}:/var/solr/data
ports:
- ${SOLR_HTTP}:8983
ubo:
container_name: ${NAME}-ubo
image: mycoreorg/ubo:develop
restart: unless-stopped
environment:
- APP_CONTEXT=${APP_CONTEXT}
- JDBC_NAME=${DB_USER}
- JDBC_PASSWORD=${DB_PASSWORD}
- JDBC_DRIVER=org.postgresql.Driver
- JDBC_URL=jdbc:postgresql://db:5432/ubo
- SOLR_URL=http://solr:8983
- SOLR_CORE=ubo
- SOLR_CLASSIFICATION_CORE=ubo-classifications
- XMX=${APP_XMX}
- XMS=${APP_XMS}
volumes:
- ${APP_HOME}:/mcr/home/
- ${APP_DATA}:/mcr/data/
- ${APP_LOGS}:/mcr/logs/
- ${APP_TMP}:/mcr/tmp/
depends_on:
- db
- solr
ports:
- ${APP_HTTP}:8080
- ${APP_AJP}:8009
51 changes: 51 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: '3.1'

services:
db:
container_name: ${NAME}-db
image: postgres:12
restart: unless-stopped
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=ubo
volumes:
- ${DB_DATA}:/var/lib/postgresql/data/
ports:
- ${DB_PORT}:5432
solr:
container_name: ${NAME}-solr
build: ubo-webapp/src/main/setup/solr/
restart: unless-stopped
volumes:
- ${SOLR_DATA}:/var/solr/data
ports:
- ${SOLR_HTTP}:8983
ubo:
container_name: ${NAME}-ubo
build: ./
restart: unless-stopped
environment:
- APP_CONTEXT=${APP_CONTEXT}
- JDBC_NAME=${DB_USER}
- JDBC_PASSWORD=${DB_PASSWORD}
- JDBC_DRIVER=org.postgresql.Driver
- JDBC_URL=jdbc:postgresql://db:5432/ubo
- SOLR_URL=http://solr:8983
- SOLR_CORE=ubo
- SOLR_CLASSIFICATION_CORE=ubo-classifications
- XMX=${APP_XMX}
- XMS=${APP_XMS}
- APP_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8295
volumes:
- ${APP_HOME}:/mcr/home/
- ${APP_DATA}:/mcr/data/
- ${APP_LOGS}:/mcr/logs/
- ${APP_TMP}:/mcr/tmp/
depends_on:
- db
- solr
ports:
- ${APP_HTTP}:8080
- ${APP_AJP}:8009
- ${APP_DEBUG}:8295
Loading

0 comments on commit 2c42c08

Please sign in to comment.