Skip to content

Commit

Permalink
Merge branch 'master' into rest-demo
Browse files Browse the repository at this point in the history
  • Loading branch information
abollini committed Feb 26, 2020
2 parents 4ae4ccf + 373e8e1 commit 4d7b767
Show file tree
Hide file tree
Showing 319 changed files with 8,805 additions and 7,813 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Expand Up @@ -2,14 +2,14 @@ language: java
sudo: false
dist: trusty

env:
env:
# Give Maven 1GB of memory to work with
- MAVEN_OPTS=-Xmx1024M

jdk:
# DS-3384 Oracle JDK 8 has DocLint enabled by default.
# DS-3384 Oracle JDK has DocLint enabled by default.
# Let's use this to catch any newly introduced DocLint issues.
- oraclejdk8
- oraclejdk11

## Should we run into any problems with oraclejdk8 on Travis, we may try the following workaround.
## https://docs.travis-ci.com/user/languages/java#Testing-Against-Multiple-JDKs
Expand All @@ -19,7 +19,6 @@ jdk:
# packages:
# - oracle-java8-installer

# Install prerequisites for building Mirage2 more rapidly
before_install:
# Remove outdated settings.xml from Travis builds. Workaround for https://github.com/travis-ci/travis-ci/issues/4629
- rm ~/.m2/settings.xml
Expand Down
17 changes: 8 additions & 9 deletions Dockerfile.jdk8 → Dockerfile
@@ -1,12 +1,11 @@
# This image will be published as dspace/dspace
# See https://dspace-labs.github.io/DSpace-Docker-Images/ for usage details
# See https://github.com/DSpace/DSpace/tree/master/dspace/src/main/docker for usage details
#
# This version is JDK8 compatible
# - tomcat:8-jre8
# This version is JDK11 compatible
# - tomcat:8-jdk11
# - ANT 1.10.7
# - maven:3-jdk-8
# - note:
# - default tag for branch: dspace/dspace: dspace/dspace:dspace-7_x-jdk8
# - maven:3-jdk-11 (see dspace-dependencies)
# - note: default tag for branch: dspace/dspace: dspace/dspace:dspace-7_x

# Step 1 - Run Maven Build
FROM dspace/dspace-dependencies:dspace-7_x as build
Expand All @@ -30,7 +29,7 @@ RUN mvn package && \
mvn clean

# Step 2 - Run Ant Deploy
FROM tomcat:8-jre8 as ant_build
FROM tomcat:8-jdk11 as ant_build
ARG TARGET_DIR=dspace-installer
COPY --from=build /install /dspace-src
WORKDIR /dspace-src
Expand All @@ -47,7 +46,7 @@ RUN ant init_installation update_configs update_code update_webapps

# Step 3 - Run tomcat
# Create a new tomcat image that does not retain the the build directory contents
FROM tomcat:8-jre8
FROM tomcat:8-jdk11
ENV DSPACE_INSTALL=/dspace
COPY --from=ant_build /dspace $DSPACE_INSTALL
EXPOSE 8080 8009
Expand All @@ -63,4 +62,4 @@ RUN ln -s $DSPACE_INSTALL/webapps/server /usr/local/tomcat/webapps/server &&
# Please note that server webapp should only run on one path at a time.
#RUN mv /usr/local/tomcat/webapps/ROOT /usr/local/tomcat/webapps/ROOT.bk && \
# ln -s $DSPACE_INSTALL/webapps/server /usr/local/tomcat/webapps/ROOT && \
# ln -s $DSPACE_INSTALL/webapps/rest /usr/local/tomcat/webapps/rest
# ln -s $DSPACE_INSTALL/webapps/rest /usr/local/tomcat/webapps/rest
15 changes: 7 additions & 8 deletions Dockerfile.cli.jdk8 → Dockerfile.cli
@@ -1,12 +1,11 @@
# This image will be published as dspace/dspace-cli
# See https://dspace-labs.github.io/DSpace-Docker-Images/ for usage details
# See https://github.com/DSpace/DSpace/tree/master/dspace/src/main/docker for usage details
#
# This version is JDK8 compatible
# - openjdk:8-jdk
# This version is JDK11 compatible
# - openjdk:11
# - ANT 1.10.7
# - maven:3-jdk-8
# - note:
# - default tag for branch: dspace/dspace-cli: dspace/dspace-cli:dspace-7_x
# - maven:3-jdk-11 (see dspace-dependencies)
# - note: default tag for branch: dspace/dspace-cli: dspace/dspace-cli:dspace-7_x

# Step 1 - Run Maven Build
FROM dspace/dspace-dependencies:dspace-7_x as build
Expand All @@ -30,7 +29,7 @@ RUN mvn package -P'!dspace-rest' && \
mvn clean

# Step 2 - Run Ant Deploy
FROM openjdk:8-jdk as ant_build
FROM openjdk:11 as ant_build
ARG TARGET_DIR=dspace-installer
COPY --from=build /install /dspace-src
WORKDIR /dspace-src
Expand All @@ -47,7 +46,7 @@ RUN ant init_installation update_configs update_code

# Step 3 - Run jdk
# Create a new tomcat image that does not retain the the build directory contents
FROM openjdk:8-jdk
FROM openjdk:11
ENV DSPACE_INSTALL=/dspace
COPY --from=ant_build /dspace $DSPACE_INSTALL

Expand Down
15 changes: 9 additions & 6 deletions Dockerfile.dependencies
@@ -1,8 +1,11 @@
# This image will be published as dspace/dspace-dependencies
# The purpose of this image is to make the build for dspace/dspace run faster
# The purpose of this image is to make the build for dspace/dspace run faster
#
# This version is JDK11 compatible
# - maven:3-jdk-11

# Step 1 - Run Maven Build
FROM maven:3-jdk-8 as build
FROM maven:3-jdk-11 as build
ARG TARGET_DIR=dspace-installer
WORKDIR /app

Expand All @@ -16,9 +19,9 @@ ADD --chown=dspace . /app/
COPY dspace/src/main/docker/local.cfg /app/local.cfg

# Trigger the installation of all maven dependencies
# Clean up the built artifacts in the same step to keep the docker image small
RUN mvn package && mvn clean
RUN mvn package

# Clear the contents of the /app directory so no artifacts are left when dspace:dspace is built
# Clear the contents of the /app directory (including all maven builds), so no artifacts remain.
# This ensures when dspace:dspace is built, it will just the Maven local cache (.m2) for dependencies
USER root
RUN rm -rf /app/*
RUN rm -rf /app/*
19 changes: 10 additions & 9 deletions Dockerfile.jdk8-test → Dockerfile.test
@@ -1,12 +1,13 @@
# This image will be published as dspace/dspace
# See https://dspace-labs.github.io/DSpace-Docker-Images/ for usage details
# See https://github.com/DSpace/DSpace/tree/master/dspace/src/main/docker for usage details
#
# This version is JDK8 compatible
# - tomcat:8-jre8
# This version is JDK11 compatible
# - tomcat:8-jdk11
# - ANT 1.10.7
# - maven:3-jdk-8
# - note:
# - default tag for branch: dspace/dspace: dspace/dspace:dspace-7_x-jdk8-test
# - maven:3-jdk-11 (see dspace-dependencies)
# - note: default tag for branch: dspace/dspace: dspace/dspace:dspace-7_x-test
#
# This image is meant for TESTING/DEVELOPMENT ONLY as it deploys the old v6 REST API under HTTP (not HTTPS)

# Step 1 - Run Maven Build
FROM dspace/dspace-dependencies:dspace-7_x as build
Expand All @@ -30,7 +31,7 @@ RUN mvn package && \
mvn clean

# Step 2 - Run Ant Deploy
FROM tomcat:8-jre8 as ant_build
FROM tomcat:8-jdk11 as ant_build
ARG TARGET_DIR=dspace-installer
COPY --from=build /install /dspace-src
WORKDIR /dspace-src
Expand All @@ -47,7 +48,7 @@ RUN ant init_installation update_configs update_code update_webapps

# Step 3 - Run tomcat
# Create a new tomcat image that does not retain the the build directory contents
FROM tomcat:8-jre8
FROM tomcat:8-jdk11
ENV DSPACE_INSTALL=/dspace
COPY --from=ant_build /dspace $DSPACE_INSTALL
EXPOSE 8080 8009
Expand All @@ -67,4 +68,4 @@ RUN ln -s $DSPACE_INSTALL/webapps/server /usr/local/tomcat/webapps/server &&

# Overwrite the v6.x (deprecated) REST API's web.xml, so that we can run it on HTTP (defaults to requiring HTTPS)
COPY dspace/src/main/docker/test/rest_web.xml $DSPACE_INSTALL/webapps/rest/WEB-INF/web.xml
RUN sed -i -e "s|\${dspace.dir}|$DSPACE_INSTALL|" $DSPACE_INSTALL/webapps/rest/WEB-INF/web.xml
RUN sed -i -e "s|\${dspace.dir}|$DSPACE_INSTALL|" $DSPACE_INSTALL/webapps/rest/WEB-INF/web.xml
2 changes: 1 addition & 1 deletion docker-compose-cli.yml
Expand Up @@ -6,7 +6,7 @@ services:
container_name: dspace-cli
build:
context: .
dockerfile: Dockerfile.cli.jdk8
dockerfile: Dockerfile.cli
#environment:
volumes:
- ./dspace/src/main/docker-compose/local.cfg:/dspace/config/local.cfg
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Expand Up @@ -4,10 +4,10 @@ networks:
services:
dspace:
container_name: dspace
image: "${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-dspace-7_x-jdk8-test}"
image: "${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-dspace-7_x-test}"
build:
context: .
dockerfile: Dockerfile.jdk8-test
dockerfile: Dockerfile.test
depends_on:
- dspacedb
networks:
Expand Down

0 comments on commit 4d7b767

Please sign in to comment.