-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.ci.yml
31 lines (30 loc) · 1.14 KB
/
docker-compose.ci.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
version: '2.4'
services:
gradle:
build:
context: .
dockerfile: ./Dockerfile
environment:
- CI=${CI:-}
volumes:
# gradle caches
- ~/.gradle/caches/modules-2:/root/.gradle/caches/modules-2:z
- ~/.gradle/wrapper/dists:/root/.gradle/wrapper/dists:z
# exclude these from workdir mount
- /opt/build/PaperX-API/
- /opt/build/PaperX-Server/
# only allow reads to the git repo
- .git/:/opt/build/.git/:ro
# paperweight cache contains files that save the absolute path,
# so we create a special volume to cache this directory
# NOTE: a named volume would be better for this, but github actions does
# not allow you to cache /var/lib/docker/volumes
- ./.gradle/paperweight_cache/:/opt/build/.gradle/caches/paperweight/:Z
# mount working directory
- ./:/opt/build:Z
working_dir: /opt/build
# these two gradle tasks must be run independently, otherwise it will fail
command: bash -c 'set -x
&& ./gradlew --no-daemon applyPatches --stacktrace
&& ./gradlew --no-daemon createReobfPaperclipJar --stacktrace
&& chmod a+rw build/libs/*'