-
Notifications
You must be signed in to change notification settings - Fork 425
198 lines (195 loc) · 7.19 KB
/
build-latest.yaml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: build-latest
on:
workflow_dispatch:
pull_request:
branches:
- develop
push:
branches:
- develop
jobs:
build-activemq-docker-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image for testing activeqm
id: docker_build_testing_image_activeqm
uses: docker/build-push-action@v5
with:
context: ./clustering/activemq-docker/
file: ./clustering/activemq-docker/Dockerfile
push: false
load: true
tags: kartoza/activemq-docker:manual-build
outputs: type=docker,dest=/tmp/activemq.tar
cache-from: |
type=gha,scope=test
type=gha,scope=prod
cache-to: type=gha,scope=test
target: activemq-prod
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: kartoza-activemq
path: /tmp/activemq.tar
build-docker-image:
runs-on: ubuntu-latest
strategy:
matrix:
geoserverMajorVersion:
- 2
imageVersion:
- image: 9.0.73-jdk11-temurin-focal
javaHome: /opt/java/openjdk
geoserverMinorVersion:
- minor: 24
patch: 2
downloadAllStableExtensions:
- 1
downloadAllCommunityExtensions:
- 1
stablePluginBaseURL:
- https://sourceforge.net/projects/geoserver/files/GeoServer
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image for testing
id: docker_build_testing_image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: false
load: true
tags: kartoza/geoserver:manual-build
outputs: type=docker,dest=/tmp/geoserver.tar
build-args: |
IMAGE_VERSION=${{ matrix.imageVersion.image }}
JAVA_HOME=${{ matrix.imageVersion.javaHome }}
GS_VERSION=${{ matrix.geoserverMajorVersion }}.${{ matrix.geoserverMinorVersion.minor }}.${{ matrix.geoserverMinorVersion.patch }}
WAR_URL=https://downloads.sourceforge.net/project/geoserver/GeoServer/${{ matrix.geoserverMajorVersion }}.${{ matrix.geoserverMinorVersion.minor }}.${{ matrix.geoserverMinorVersion.patch }}/geoserver-${{ matrix.geoserverMajorVersion }}.${{ matrix.geoserverMinorVersion.minor }}.${{ matrix.geoserverMinorVersion.patch }}-war.zip
DOWNLOAD_ALL_STABLE_EXTENSIONS=${{ matrix.downloadAllStableExtensions }}
DOWNLOAD_ALL_COMMUNITY_EXTENSIONS=${{ matrix.downloadAllCommunityExtensions }}
STABLE_PLUGIN_BASE_URL=${{ matrix.stablePluginBaseURL }}
cache-from: |
type=gha,scope=test
type=gha,scope=prod
cache-to: type=gha,scope=test
target: geoserver-test
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: kartoza-geoserver
path: /tmp/geoserver.tar
run-scenario-tests:
runs-on: ubuntu-latest
needs: [ build-docker-image, build-activemq-docker-image]
strategy:
matrix:
scenario:
- gwc
- login
- stores
- context
- disk-quota
- clustering
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: kartoza-geoserver
path: /tmp
- name: Load image
run: |
docker load --input /tmp/geoserver.tar
- name: Download ActiveMQ artifact
if: matrix.scenario == 'clustering'
uses: actions/download-artifact@v4
with:
name: kartoza-activemq
path: /tmp
- name: Load ActiveMQ image
if: matrix.scenario == 'clustering'
run: |
docker load --input /tmp/activemq.tar
- name: Run scenario test ${{ matrix.scenario }}
working-directory: scenario_tests/${{ matrix.scenario }}
env:
COMPOSE_INTERACTIVE_NO_CLI: 1
PRINT_TEST_LOGS: 1
run: |
# Use the built Docker image to run scenario tests
bash ./test.sh
push-internal-pr-images:
if: github.event_name == 'pull_request' && github.event.pull_request.base.repo.url == github.event.pull_request.head.repo.url
runs-on: ubuntu-latest
needs: [run-scenario-tests]
strategy:
matrix:
geoserverMajorVersion:
- 2
imageVersion:
- image: 9.0.73-jdk11-temurin-focal
javaHome: /opt/java/openjdk
geoserverMinorVersion:
- minor: 24
patch: 2
downloadAllStableExtensions:
- 1
downloadAllCommunityExtensions:
- 1
stablePluginBaseURL:
# empty because it often changes, so it's better
# to use the default one described in the Dockerfile
# to make it consistent. How-ever we keep this in GH Action
# to make it easy to pass overrides in the future.
- https://sourceforge.net/projects/geoserver/files/GeoServer
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKERHUB_REPO}}/geoserver
tags: |
type=semver,pattern=\d.\d.\d
type=ref,event=branch
- name: Build image for testing
id: docker_build_testing_image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: false
tags: |
kartoza/geoserver:manual-build
build-args: |
IMAGE_VERSION=${{ matrix.imageVersion.image }}
JAVA_HOME=${{ matrix.imageVersion.javaHome }}
GS_VERSION=${{ matrix.geoserverMajorVersion }}.${{ matrix.geoserverMinorVersion.minor }}.${{ matrix.geoserverMinorVersion.patch }}
WAR_URL=https://downloads.sourceforge.net/project/geoserver/GeoServer/${{ matrix.geoserverMajorVersion }}.${{ matrix.geoserverMinorVersion.minor }}.${{ matrix.geoserverMinorVersion.patch }}/geoserver-${{ matrix.geoserverMajorVersion }}.${{ matrix.geoserverMinorVersion.minor }}.${{ matrix.geoserverMinorVersion.patch }}-war.zip
DOWNLOAD_ALL_STABLE_EXTENSIONS=${{ matrix.downloadAllStableExtensions }}
DOWNLOAD_ALL_COMMUNITY_EXTENSIONS=${{ matrix.downloadAllCommunityExtensions }}
STABLE_PLUGIN_BASE_URL=${{ matrix.stablePluginBaseURL }}
cache-from: |
type=gha,scope=test
type=gha,scope=prod
cache-to: type=gha,scope=test
target: geoserver-test