-
Notifications
You must be signed in to change notification settings - Fork 52
371 lines (364 loc) · 12.7 KB
/
ci.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
name: Java CI
on:
push:
pull_request:
types: [opened, reopened]
jobs:
build-oss:
strategy:
fail-fast: false
matrix:
cassandra-version: ['3.11', '4.0', '4.1', '3.11_ubi', '4.0_ubi', '4.1_ubi']
itTest : ['LifecycleIT', 'KeepAliveIT', 'NonDestructiveOpsIT', 'DestructiveOpsIT']
include:
- cassandra-version: '3.11'
run311tests: true
run311testsUBI: false
run40tests: false
run40testsUBI: false
run41tests: false
run41testsUBI: false
- cassandra-version: '4.0'
run311tests: false
run311testsUBI: false
run40tests: true
run40testsUBI: false
run41tests: false
run41testsUBI: false
- cassandra-version: '4.1'
run311tests: false
run311testsUBI: false
run40tests: false
run40testsUBI: false
run41tests: true
run41testsUBI: false
- cassandra-version: '3.11_ubi'
run311tests: false
run311testsUBI: true
run40tests: false
run40testsUBI: false
run41tests: false
run41testsUBI: false
- cassandra-version: '4.0_ubi'
run311tests: false
run311testsUBI: false
run40tests: false
run40testsUBI: true
run41tests: false
run41testsUBI: false
- cassandra-version: '4.1_ubi'
run311tests: false
run311testsUBI: false
run40tests: false
run40testsUBI: false
run41tests: false
run41testsUBI: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: latest
- name: Build with Maven and run tests
run: |
mvn -B -q install --file pom.xml \
-Drun311tests=${{ matrix.run311tests }} \
-Drun40tests=${{ matrix.run40tests }} \
-Drun41tests=${{ matrix.run41tests }} \
-Drun311testsUBI=${{ matrix.run311testsUBI }} \
-Drun40testsUBI=${{ matrix.run40testsUBI }} \
-Drun41testsUBI=${{ matrix.run41testsUBI }} \
-Dit.test=${{ matrix.itTest }} -DfailIfNoTests=false
build-dse:
if: github.repository_owner == 'k8ssandra'
strategy:
fail-fast: false
matrix:
platform-version: ['jdk8', 'ubi']
itTest : ['LifecycleIT', 'KeepAliveIT', 'NonDestructiveOpsIT', 'DestructiveOpsIT', 'DSESpecificIT']
include:
- platform-version: 'jdk8'
runDSEtests: true
runDSEtestsUBI: false
- platform-version: 'ubi'
runDSEtests: false
runDSEtestsUBI: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: latest
- name: Build with Maven and run tests
run: |
cat <<EOF > ~/.m2/settings.xml
<settings>
<servers>
<server>
<id>artifactory-snapshots</id>
<username>${{ secrets.ARTIFACTORY_USERNAME }}</username>
<password>${{ secrets.ARTIFACTORY_PASSWORD }}</password>
</server>
<server>
<id>artifactory-releases</id>
<username>${{ secrets.ARTIFACTORY_USERNAME }}</username>
<password>${{ secrets.ARTIFACTORY_PASSWORD }}</password>
</server>
</servers>
</settings>
EOF
cp ~/.m2/settings.xml settings.xml
mvn -B -q install --file pom.xml -P dse -Dit.test=${{ matrix.itTest }} -DfailIfNoTests=false \
-DrunDSEtests=${{ matrix.runDSEtests }} \
-DrunDSEtestsUBI=${{ matrix.runDSEtestsUBI }}
build-dse7:
if: github.repository_owner == 'k8ssandra'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: latest
- name: Build with Maven and run tests
run: |
cat <<EOF > ~/.m2/settings.xml
<settings>
<servers>
<server>
<id>artifactory-snapshots</id>
<username>${{ secrets.ARTIFACTORY_USERNAME }}</username>
<password>${{ secrets.ARTIFACTORY_PASSWORD }}</password>
</server>
<server>
<id>artifactory-releases</id>
<username>${{ secrets.ARTIFACTORY_USERNAME }}</username>
<password>${{ secrets.ARTIFACTORY_PASSWORD }}</password>
</server>
<server>
<id>artifactory</id>
<username>${{ secrets.ARTIFACTORY_USERNAME }}</username>
<password>${{ secrets.ARTIFACTORY_PASSWORD }}</password>
</server>
</servers>
</settings>
EOF
cp ~/.m2/settings.xml settings.xml
mvn -B -q install --file pom.xml -P dse7
publish-oss:
name: Publish ${{ matrix.cassandra-version }} Cassandra image
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push'}}
needs: build-oss
runs-on: ubuntu-latest
strategy:
matrix:
include:
- cassandra-version: '3.11'
docker-file: Dockerfile-oss
build-target: oss311
- cassandra-version: '4.0'
docker-file: Dockerfile-4_0
build-target: oss40
- cassandra-version: '4.1'
docker-file: Dockerfile-4_1
build-target: oss41
- cassandra-version: '3.11-ubi8'
docker-file: Dockerfile-oss.ubi8
build-target: oss311
- cassandra-version: '4.0-ubi8'
docker-file: Dockerfile-4_0.ubi8
build-target: oss40
- cassandra-version: '4.1-ubi8'
docker-file: Dockerfile-4_1.ubi8
build-target: oss41
steps:
- name: Check out source code
uses: actions/checkout@v3
# Setup metadata based on the commit/tag that will be used for tagging the image
# Only build and publish a commit based tag
- name: Setup Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: k8ssandra/cass-management-api
tags: type=sha,prefix=${{ matrix.cassandra-version }}-
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build and push Cassandra ${{ matrix.cassandra-version }}
id: docker_build
uses: docker/build-push-action@v4
with:
file: ${{ matrix.docker-file }}
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
target: ${{ matrix.build-target }}
publish-dse-ubuntu:
name: Publish DSE 6.8 Ubuntu image
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push'}}
needs: build-dse
runs-on: ubuntu-latest
strategy:
matrix:
jdk-version: [jdk8, jdk11]
steps:
- name: Check out source code
uses: actions/checkout@v3
- name: Setup Maven settings file
run: |
mkdir -p ~/.m2
cat <<EOF > ~/.m2/settings.xml
<settings>
<servers>
<server>
<id>artifactory-snapshots</id>
<username>${{ secrets.ARTIFACTORY_USERNAME }}</username>
<password>${{ secrets.ARTIFACTORY_PASSWORD }}</password>
</server>
<server>
<id>artifactory-releases</id>
<username>${{ secrets.ARTIFACTORY_USERNAME }}</username>
<password>${{ secrets.ARTIFACTORY_PASSWORD }}</password>
</server>
</servers>
</settings>
EOF
cp ~/.m2/settings.xml settings.xml
# Setup metadata based on the commit/tag that will be used for tagging the image
# Only build and publish a commit based tag
- name: Setup Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: datastax/dse-mgmtapi-6_8
tags: type=sha,prefix=dse68-${{ matrix.jdk-version }}-
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build and push DSE 6.8-${{ matrix.jdk-version }}
id: docker_build
uses: docker/build-push-action@v3
with:
file: dse-68/Dockerfile.${{ matrix.jdk-version }}
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
target: dse68
publish-dse-ubi:
name: Publish DSE 6.8 UBI 8 image
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push'}}
needs: publish-dse-ubuntu
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v3
- name: Setup Maven settings file
run: |
mkdir -p ~/.m2
cat <<EOF > ~/.m2/settings.xml
<settings>
<servers>
<server>
<id>artifactory-snapshots</id>
<username>${{ secrets.ARTIFACTORY_USERNAME }}</username>
<password>${{ secrets.ARTIFACTORY_PASSWORD }}</password>
</server>
<server>
<id>artifactory-releases</id>
<username>${{ secrets.ARTIFACTORY_USERNAME }}</username>
<password>${{ secrets.ARTIFACTORY_PASSWORD }}</password>
</server>
</servers>
</settings>
EOF
cp ~/.m2/settings.xml settings.xml
# Setup metadata based on the commit/tag that will be used for tagging the image
# Only build and publish a commit based tag
- name: Setup Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: datastax/dse-mgmtapi-6_8
tags: type=sha,prefix=dse68-ubi8-
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build and push DSE 6.8-ubi8
id: docker_build
uses: docker/build-push-action@v3
with:
file: dse-68/Dockerfile.ubi8
build-args: VERSION=dse68-jdk8-${{ steps.vars.outputs.sha_short }}
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
target: dse68