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

Wip dockermaven #2504

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

/build/
/*/build/
target
core/target
servlet/target

/examples/geoserver-data/.updatepassword.lock
/examples/geoserver-data/controlflow.properties
Expand All @@ -20,3 +23,5 @@
/examples/geoserver-data/wps.xml

/CI.asc
*~

47 changes: 28 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,47 @@
FROM gradle:6.9-jdk11 AS builder
#FROM maven:3.8.5-eclipse-temurin-11-alpine@sha256:b4083a13f534f6256179802b3deaeadccf4b8eb9bcb4c8a35b78919624b18448 AS builder
FROM maven:3.8.5-eclipse-temurin-11-focal@sha256:a5a8b7b6ae4b7045c42ab9c21b72cdffe43db8eebf8bbf5a741f2660453c86ba AS base

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
mvn --version

WORKDIR /src

COPY gradle/ ./gradle/
COPY gradle.properties build.gradle settings.gradle CI.asc ./
COPY examples/build.gradle ./examples/
COPY docs/build.gradle ./docs/
COPY publish/build.gradle ./publish/
COPY pom.xml ./
COPY core ./core
COPY checkstyle_* ./
COPY servlet ./servlet

FROM base AS builder
RUN mvn -B dependency:resolve -projects core

FROM builder AS cachedbuiler

# COPY checkstyle_* ./
# COPY gradle.properties build.gradle settings.gradle CI.asc ./
# COPY examples/build.gradle ./examples/
# COPY docs/build.gradle ./docs/
# COPY publish/build.gradle ./publish/

# '&& 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
RUN mvn -B clean install

ARG GIT_HEAD
ENV GIT_HEAD=${GIT_HEAD}
# ARG GIT_HEAD
# ENV GIT_HEAD=${GIT_HEAD}

COPY publish ./publish
# 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
# 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
# FROM builder AS test-builder

RUN [ -e success ] && [ -e success-publish ] && [ -e success-examples-docs ]
# RUN [ -e success ] && [ -e success-publish ] && [ -e success-examples-docs ]

VOLUME [ "/src/core" ]
# VOLUME [ "/src/core" ]
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ configurations.all {
apply plugin: 'org.owasp.dependencycheck'

configure(subprojects.findAll { ['core', 'examples'].contains(it.name) }) {
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'com.github.spotbugs'
apply plugin: 'eclipse'
Expand Down
Loading