Skip to content
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
27 changes: 8 additions & 19 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,14 @@ on:

jobs:
build:
strategy:
matrix:
platform: [ ubuntu-latest ]
java-version: [ 8 ]

runs-on: ${{ matrix.platform }}
env:
PLATFORM: ${{ matrix.platform }}
JAVA_VERSION: ${{ matrix.java-version }}

runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
cache: 'maven'
- name: Build with Maven
id: build_with_maven
- name: Build Docker image
id: build_docker_image
run: |
./build-docker-image.sh
- name: Maven Build with Docker
id: run_docker_image
run: |
mvn clean install --batch-mode --file pom.xml
./build.sh clean install
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM maven:3-jdk-8-slim

ARG DEBIAN_FRONTEND=noninteractive

ENV MAVEN_CONFIG="/var/maven/.m2"
ENV HOME="/var/maven"
ENV MAVEN_HOME="/var/maven"
ENV MAVEN_OPTS="-Duser.home=/var/maven"

ADD target/docker-build/.m2 /var/maven/.m2

WORKDIR /data

ENTRYPOINT ["mvn"]
9 changes: 9 additions & 0 deletions build-docker-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -eux

BUILD_DIR="target/docker-build"
rm -fR ${BUILD_DIR}
mkdir -p ${BUILD_DIR}

unzip m2.zip -d ${BUILD_DIR}

docker build -t partnersinhealth/petl-maven-build .
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash -eux

docker run --rm -v .:/data -v /var/run/docker.sock:/var/run/docker.sock partnersinhealth/petl-maven-build $@
Binary file added m2.zip
Binary file not shown.