Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some little changes, see comit for details #2123

Merged
merged 6 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:

jobs:
CodeQL-Build:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
name: Code scanning
timeout-minutes: 15

Expand All @@ -20,6 +20,13 @@ jobs:
uses: actions/checkout@v2
if: env.HAS_SECRETS == 'HAS_SECRETS'

- name: Setup Java JDK
uses: actions/setup-java@v2
with:
java-version: 11
distribution: temurin
if: env.HAS_SECRETS == 'HAS_SECRETS'

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
if: env.HAS_SECRETS == 'HAS_SECRETS'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- uses: actions/upload-artifact@v1
with:
name: Test results
path: core/build/resources/actual
path: core/build/resources/
if-no-files-found: ignore
if: failure()
- uses: actions/upload-artifact@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
rebuild:
runs-on: ubuntu-20.04
timeout-minutes: 30
timeout-minutes: 40
name: Rebuild

strategy:
Expand Down
2 changes: 2 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignored:
- DL3008 # pin version: https://github.com/hadolint/hadolint/wiki/DL3008
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM gradle:6.6-jdk11 AS builder

RUN apt update
RUN apt install --yes fonts-liberation gettext curl
RUN gradle --version
RUN apt-get update && \
apt-get install --yes --no-install-recommends fonts-liberation gettext curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
gradle --version

WORKDIR /src

Expand All @@ -15,19 +17,19 @@ COPY core ./core
COPY checkstyle_* ./

# '&& touch success || true' is a trick to be able to get out some artifacts
RUN gradle :core:build :core:explodedWar :core:libSourcesJar :core:libJavadocJar && touch success || true
RUN (gradle :core:build :core:explodedWar :core:libSourcesJar :core:libJavadocJar && touch success) || true

ARG GIT_HEAD
ENV GIT_HEAD=${GIT_HEAD}

COPY publish ./publish

RUN [ -e success ] && gradle :publish:build && touch success-publish || true
RUN ([ -e success ] && (gradle :publish:build && touch success-publish)) || true

COPY examples ./examples
COPY docs ./docs

RUN [ -e success ] && gradle :examples:build buildDocs && touch success-examples-docs || true
RUN ([ -e success ] && (gradle :examples:build buildDocs && touch success-examples-docs)) || true

FROM builder AS test-builder

Expand Down
35 changes: 16 additions & 19 deletions core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,28 @@ FROM mapfish_print_builder AS builder
FROM tomcat:9.0-jdk11-openjdk-slim AS runner
LABEL maintainer="Camptocamp <[email protected]>"

RUN perl -0777 -i -pe 's/(<Valve className="org.apache.catalina.valves.AccessLogValve"[^>]*>)/<Valve className="ch.qos.logback.access.tomcat.LogbackValve" quiet="true"\/>/s' ${CATALINA_HOME}/conf/server.xml && \
echo "tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*" >> ${CATALINA_HOME}/conf/catalina.properties && \
echo "org.apache.catalina.startup.TldConfig.jarsToSkip=*" >> ${CATALINA_HOME}/conf/catalina.properties && \
echo "tomcat.util.scan.DefaultJarScanner.jarsToSkip=*" >> ${CATALINA_HOME}/conf/catalina.properties && \
perl -0777 -i -pe 's/<\/Context>/<Resources cachingAllowed="true" cacheMaxSize="102400"\/><\/Context>/' ${CATALINA_HOME}/conf/context.xml

RUN mkdir --parent /usr/local/tomcat/conf/Catalina /usr/local/tomcat/work/Catalina && \
RUN perl -0777 -i -pe 's/(<Valve className="org.apache.catalina.valves.AccessLogValve"[^>]*>)/<Valve className="ch.qos.logback.access.tomcat.LogbackValve" quiet="true"\/>/s' "${CATALINA_HOME}/conf/server.xml" && \
echo "tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*" >> "${CATALINA_HOME}/conf/catalina.properties" && \
echo "org.apache.catalina.startup.TldConfig.jarsToSkip=*" >> "${CATALINA_HOME}/conf/catalina.properties" && \
echo "tomcat.util.scan.DefaultJarScanner.jarsToSkip=*" >> "${CATALINA_HOME}/conf/catalina.properties" && \
perl -0777 -i -pe 's/<\/Context>/<Resources cachingAllowed="true" cacheMaxSize="102400"\/><\/Context>/' "${CATALINA_HOME}/conf/context.xml" && \
mkdir --parent /usr/local/tomcat/conf/Catalina /usr/local/tomcat/work/Catalina && \
chmod -R g+rwx /usr/local/tomcat/conf/Catalina /usr/local/tomcat/work && \
chgrp -R root /usr/local/tomcat/conf/Catalina /usr/local/tomcat/work && \
chmod g+r /usr/local/tomcat/conf/*

RUN \
chmod g+r /usr/local/tomcat/conf/* && \
apt-get update && \
apt-get install --assume-yes --no-install-recommends curl \
fonts-liberation fonts-dejavu fontconfig && \
apt-get clean && \
rm --recursive --force /var/lib/apt/lists/*

COPY --from=builder /src/core/build/webapp ${CATALINA_HOME}/webapps/ROOT/
COPY --from=builder /src/examples/build/classes/java/test/org/mapfish/print/HumanAlphaSerie.class ${CATALINA_HOME}/webapps/ROOT/WEB-INF/classes/org/mapfish/print/
COPY --from=builder /src/core/build/webapp "${CATALINA_HOME}/webapps/ROOT/"
COPY --from=builder /src/examples/build/classes/java/test/org/mapfish/print/HumanAlphaSerie.class "${CATALINA_HOME}/webapps/ROOT/WEB-INF/classes/org/mapfish/print/"
COPY docker /

RUN mkdir -p ${CATALINA_HOME}/extlib/classes/org/mapfish/print && \
cp -r ${CATALINA_HOME}/webapps/ROOT/WEB-INF/classes/org/mapfish/print/url ${CATALINA_HOME}/extlib/classes/org/mapfish/print/ && \
perl -0777 -i -pe 's/<Valve className="ch.qos.logback.access.tomcat.LogbackValve" quiet="true"\/>//s' ${CATALINA_HOME}/conf/server.xml && \
RUN mkdir -p "${CATALINA_HOME}/extlib/classes/org/mapfish/print" && \
cp -r "${CATALINA_HOME}/webapps/ROOT/WEB-INF/classes/org/mapfish/print/url" "${CATALINA_HOME}/extlib/classes/org/mapfish/print/" && \
perl -0777 -i -pe 's/<Valve className="ch.qos.logback.access.tomcat.LogbackValve" quiet="true"\/>//s' "${CATALINA_HOME}/conf/server.xml" && \
chmod g+r -R /usr/local/tomcat/conf/ && \
chmod g+rw /usr/local/tomcat/temp/ /usr/local/tomcat/webapps/ROOT/WEB-INF/lib && \
chmod g+rw /usr/local/tomcat/webapps/ROOT/WEB-INF/classes /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/*.xml && \
Expand Down Expand Up @@ -60,10 +57,10 @@ COPY jettyRunExtraFiles/mapfish-spring-application-context-override-acceptencete

FROM runner AS watcher

RUN apt update && \
apt install --yes python3-pip rsync && \
RUN apt-get update && \
apt-get install --yes --no-install-recommends python3-pip rsync && \
apt-get clean && \
rm --recursive --force /var/lib/apt/lists/*
RUN python3 -m pip --disable-pip-version-check --no-cache-dir install inotify
rm --recursive --force /var/lib/apt/lists/* && \
python3 -m pip --disable-pip-version-check --no-cache-dir install inotify

FROM runner AS final
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ dependencies {

def gitRevision() {
def gitRev = System.getenv('GIT_HEAD')
return gitRev != null ? gitRev : "git rev-parse HEAD | tr -d '[\n]'".execute().text
return gitRev != null ? gitRev : "git rev-parse HEAD".execute().text.trim()
}

compileJava.options.compilerArgs = ['-Xlint:deprecation', '-Xlint:unchecked']
Expand Down