1
1
name : Publish Container
2
- on : [push, pull_request]
2
+ on :
3
+ push :
4
+ pull_request :
5
+ schedule :
6
+ - cron : " 0 6 * * *"
7
+ workflow_dispatch :
8
+
3
9
jobs :
4
10
build :
5
11
name : Test and Publish Container Images
6
12
runs-on : ubuntu-latest
7
13
# NOTE (DP): Publish on develop and master, test on PRs against these
8
- # TODO(DP) Reinstate CRONed release builds to update stock apps regularly
9
14
if : github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' || github.base_ref == 'develop' || github.base_ref == 'master'
10
15
steps :
11
16
- uses : actions/checkout@v4
19
24
- name : Set up QEMU
20
25
uses : docker/setup-qemu-action@v3
21
26
with :
22
- platforms : linux/amd64,linux/arm64
27
+ platforms : linux/amd64,linux/arm64
23
28
- name : Make buildkit default
24
29
uses : docker/setup-buildx-action@v3
25
30
id : buildx
@@ -36,20 +41,38 @@ jobs:
36
41
# Hack around #5450
37
42
- name : pull base image
38
43
run : |
39
- docker pull --platform linux/amd64 --platform linux/arm64 gcr.io/distroless/java21-debian12:latest
44
+ docker pull --platform linux/amd64 --platform linux/arm64 gcr.io/distroless/java21-debian12:latest
40
45
- name : Build images
41
46
run : mvn -V -B -q -Pdocker -DskipTests -Ddependency-check.skip=true -P !mac-dmg-on-unix,!installer,!concurrency-stress-tests,!micro-benchmarks,skip-build-dist-archives clean package
42
47
- name : Check local images
43
48
run : docker image ls
44
49
- name : Check license headers
45
50
run : mvn license:check
46
- working-directory : exist-docker
51
+ working-directory : exist-docker
47
52
- name : Start exist-ci container
48
53
run : |
49
54
docker run -dit -p 8080:8080 --name exist-ci --rm existdb/existdb:latest
50
55
sleep 35s
51
56
- name : Run tests
52
57
run : bats --tap exist-docker/src/test/bats/*.bats
58
+
59
+ - name : debug logs
60
+ if : failure()
61
+ run : docker logs exist-ci | grep 'ERROR'
62
+
63
+ - name : Copy logs on failure
64
+ if : failure()
65
+ run : |
66
+ echo "Copying logs..."
67
+ docker cp exist-ci:/exist/logs/exist.log ./exist.log
68
+
69
+ - name : Upload logs artifact
70
+ if : failure()
71
+ uses : actions/upload-artifact@v4
72
+ with :
73
+ name : exist-core-failed-log
74
+ path : exist.log
75
+
53
76
# NOTE (DP): When on master push release, when on develop push latest: Version is included automatically
54
77
# TODO (DP): Confirm that releases triggered from maven publish images with the non SNAPSHOT version
55
78
- name : Publish latest images
76
99
# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
77
100
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
78
101
# run: mvn -q -Ddocker.tag=experimental -Ddocker.username=$DOCKER_USERNAME -Ddocker.password=$DOCKER_PASSWORD docker:build docker:push
79
- # working-directory: ./exist-docker
80
-
102
+ # working-directory: ./exist-docker
0 commit comments