-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEarthfile
25 lines (22 loc) · 850 Bytes
/
Earthfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
VERSION 0.8
FROM eclipse-temurin:21-jdk-jammy
WORKDIR /code
# Save Maven downloads across targets and runs of earthly
# This adds a layer to the image
CACHE --id maven-cache --persist maven-cache
# build builds and tests with Maven, and saves the target/ directory
build:
COPY mvnw .
COPY .mvn .mvn
COPY pom.xml .
COPY config config
COPY src src
RUN --mount type=cache,id=maven-cache,target=/root/.m2 --secret OWASP_NVD_API_KEY ./mvnw --batch-mode --no-transfer-progress clean verify site
# For CI so that GitHub can copy artifacts:
# Just copy everything rather than maintain a whitelist of files/dirs.
SAVE ARTIFACT --keep-ts target AS LOCAL target
# run runs the demo program with Maven, building if needed
run:
FROM +build
COPY run .
RUN --mount type=cache,id=maven-cache,target=/root/.m2 ./run