forked from binkley/modern-java-practices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
batect.yml
78 lines (77 loc) · 2.95 KB
/
batect.yml
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
containers:
build-env:
image: eclipse-temurin:17-jdk-focal
environment:
# Needed for Gradle: Maven handles this via `.mvn/jvm.config`
JAVA_OPTS: --add-opens java.base/java.lang=ALL-UNNAMED
run_as_current_user:
enabled: true
home_directory: /home/container-user
volumes:
- local: .
container: /code
options: cached
- local: ~/.gradle
container: /home/container-user/.gradle
options: cached
- local: ~/.m2
container: /home/container-user/.m2
options: cached
working_directory: /code
tasks:
# NB -- local build need "clean", but CI (GitHub actions) does not:
# Docker copies in the local repo clone, including any artifacts such as
# build/ or target/ directories; CI starts from a fresh clone
build-with-gradle:
description: Build and test with Gradle
run:
container: build-env
# One time only when updating to DependencyCheck plugin 7.0.0:
# command: ./gradlew --no-daemon --warning-mode=all dependencyCheckPurge clean build
command: ./gradlew --no-daemon --warning-mode=all clean build
run-with-gradle:
description: Runs the demo program assuming a Gradle build
run:
container: build-env
command: ./run-with-gradle.sh
debug-with-gradle:
description: Runs the demo program in the foreground assuming a Gradle build
# -p 5005:5005 -e JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n"
run:
container: build-env
# For a server program, set suspend=n; for command line, set suspend=y
# The "server=y" means the program provides the 5005 port for the IDE
command: ./run-with-gradle.sh --jvm-option="-Xdebug" --jvm-option="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005"
ports:
- local: 8080
container: 8080
- local: 5005
container: 5005
build-with-maven:
description: Build and test with Maven
run:
container: build-env
command: ./mvnw --no-transfer-progress clean verify site
run-with-maven:
description: Runs the demo program assuming a Maven build
run:
container: build-env
command: ./run-with-maven.sh
debug-with-maven:
description: Runs the demo program in the foreground assuming a Maven build
# -p 5005:5005 -e JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n"
run:
container: build-env
# For a server program, set suspend=n; for command line, set suspend=y
# The "server=y" means the program provides the 5005 port for the IDE
command: ./run-with-maven.sh --jvm-option="-Xdebug" --jvm-option="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005"
ports:
- local: 8080
container: 8080
- local: 5005
container: 5005
shell:
description: Open a shell in the container
run:
container: build-env
command: /bin/bash