forked from oss-review-toolkit/ort
-
Notifications
You must be signed in to change notification settings - Fork 4
/
batect.yml
93 lines (88 loc) · 3.17 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# This is a configuration file for Batect, a tool to Build And Testing Environments as Code, see
# https://batect.dev/docs/reference/config/.
forbid_telemetry: true
config_variables:
docker_build_user_id:
description: The id to use for the user running ORT
default: 1000
gradle_build_scan:
description: Enabling of Gradle build scans
# Supported values: "true", "false"
default: false
gradle_console:
description: Gradle console mode
# Supported values: "auto", "plain", "rich", "verbose"
default: rich
kotest_diff:
description: Kotest multi-line string assertion mode
# Supported values: "simple", "unified", or anything different for "condensed" output
default: unified
.common-container-config: &common-container-config
run_as_current_user:
enabled: true
home_directory: /home/ort
privileged: true
environment:
GRADLE_OPTS: -Dorg.gradle.console=<gradle_console -Dorg.gradle.daemon=false -Dkotest.assertions.multi-line-diff=<kotest_diff
GRADLE_RO_DEP_CACHE: /home/ort/.gradle-ro-dep-cache
GRADLE_BUILD_SCAN: <gradle_build_scan
volumes:
# Mount any Gradle caches present on the host as read-only into the container to speed up the build.
- local: ~/.gradle/caches
container: /home/ort/.gradle-ro-dep-cache
# Cache contents written to /home/ort/.gradle between task runs.
- type: cache
name: gradle-user-home
container: /home/ort/.gradle
# Mount the source code into the container.
- local: <{batect.project_directory}
container: /home/ort/src
working_directory: /home/ort/src
containers:
build:
image: eclipse-temurin:17-jdk-jammy
<<: *common-container-config
run:
dockerfile: Dockerfile-legacy
build_args:
USER_ID: <{docker_build_user_id}
build_directory: <{batect.project_directory}
build_target: run
<<: *common-container-config
tasks:
gradle:
description: >-
A generic task that "forwards" task arguments to Gradle. Use it like
`./batect gradle -- installDist`.
run:
container: build
command: ./gradlew --stacktrace
buildCli:
description: >-
A convenience task to build (but not run) ORT's command line interface.
run:
container: build
command: ./gradlew --stacktrace :cli:installDist
buildFunTest:
description: >-
A convenience task to build (but not run) ORT's functional tests.
run:
container: build
command: ./gradlew --stacktrace jar funTestClasses
requirements:
description: >-
A task to check ORT's requirements against the runtime container.
prerequisites:
- buildCli
run:
container: run
command: ./cli/build/install/ort/bin/ort requirements
runFunTest:
description: >-
A task to execute ORT's functional tests that require external tools in the runtime container.
prerequisites:
- buildFunTest
run:
container: run
command: "'./gradlew funTest jacocoFunTestReport -Ptests.include=org.ossreviewtoolkit.cli.*,org.ossreviewtoolkit.analyzer.*,org.ossreviewtoolkit.plugins.packagemanagers.* $(sed \"s/true/--scan/;s/false//\" <<< \"$GRADLE_BUILD_SCAN\")'"
entrypoint: /bin/bash --login -c