diff --git a/ols-apps/ols-config-importer/Dockerfile b/ols-apps/ols-config-importer/Dockerfile index d2686c55..af4ac151 100644 --- a/ols-apps/ols-config-importer/Dockerfile +++ b/ols-apps/ols-config-importer/Dockerfile @@ -2,8 +2,8 @@ FROM maven:3.6-jdk-8 AS build RUN mkdir /opt/ols COPY . /opt/ols/ -COPY build-fix/. /root/.m2/repository/ -RUN cd /opt/ols && ls && mvn clean package -DskipTests +COPY build-fix/. /root/build-fix +RUN --mount=type=cache,target=/root/.m2 mkdir -p /root/.m2/repository && cp -r /root/build-fix/* /root/.m2/repository/ && cd /opt/ols && ls && mvn clean package -DskipTests FROM openjdk:8-jre-alpine RUN apk add bash diff --git a/ols-apps/ols-indexer/Dockerfile b/ols-apps/ols-indexer/Dockerfile index 3cc38e13..bbb64436 100644 --- a/ols-apps/ols-indexer/Dockerfile +++ b/ols-apps/ols-indexer/Dockerfile @@ -1,9 +1,8 @@ - FROM maven:3.6-jdk-8 AS build RUN mkdir /opt/ols COPY . /opt/ols/ -COPY build-fix/. /root/.m2/repository/ -RUN cd /opt/ols && ls && mvn clean package -DskipTests +COPY build-fix/. /root/build-fix +RUN --mount=type=cache,target=/root/.m2 mkdir -p /root/.m2/repository && cp -r /root/build-fix/* /root/.m2/repository/ && cd /opt/ols && ls && mvn clean package -DskipTests FROM openjdk:8-jre-alpine RUN apk add bash diff --git a/ols-apps/ols-indexer/src/main/java/uk/ac/ebi/spot/ols/LoadingApplication.java b/ols-apps/ols-indexer/src/main/java/uk/ac/ebi/spot/ols/LoadingApplication.java index ffb2662d..5397c6d1 100644 --- a/ols-apps/ols-indexer/src/main/java/uk/ac/ebi/spot/ols/LoadingApplication.java +++ b/ols-apps/ols-indexer/src/main/java/uk/ac/ebi/spot/ols/LoadingApplication.java @@ -173,7 +173,7 @@ else if (deleteOntologies.length > 0){ else { // otherwise load everything set TOLOAD for (OntologyDocument document : ontologyRepositoryService.getAllDocumentsByStatus(Status.TOLOAD)) { - // try { + try { boolean loadResult = ontologyIndexingService.indexOntologyDocument(document); if (loadResult) updatedOntologies.add(document.getOntologyId()); @@ -181,14 +181,14 @@ else if (deleteOntologies.length > 0){ haserror = true; failingOntologies.put(document.getOntologyId(), "An error occurred. Check logs."); } - // } catch (Throwable t) { - // logger.error("Application failed creating indexes for " + document.getOntologyId() + ": " + - // t.getMessage(), t); - // exceptions.append(t.getMessage()); - // exceptions.append("\n"); - // haserror = true; - // failingOntologies.put(document.getOntologyId(),t.getMessage()); - // } + } catch (Throwable t) { + logger.error("Application failed creating indexes for " + document.getOntologyId() + ": " + + t.getMessage(), t); + exceptions.append(t.getMessage()); + exceptions.append("\n"); + haserror = true; + failingOntologies.put(document.getOntologyId(),t.getMessage()); + } } } diff --git a/ols-web/Dockerfile b/ols-web/Dockerfile index 7610f5c0..afa67c3f 100644 --- a/ols-web/Dockerfile +++ b/ols-web/Dockerfile @@ -1,9 +1,8 @@ - FROM maven:3.6-jdk-8 AS build RUN mkdir /opt/ols COPY . /opt/ols/ -COPY build-fix/. /root/.m2/repository/ -RUN cd /opt/ols && ls && mvn clean package -DskipTests +COPY build-fix/. /root/build-fix +RUN --mount=type=cache,target=/root/.m2 mkdir -p /root/.m2/repository && cp -r /root/build-fix/* /root/.m2/repository/ && cd /opt/ols && ls && mvn clean package -DskipTests FROM openjdk:8-jre-alpine RUN apk add bash