-
Notifications
You must be signed in to change notification settings - Fork 52
125 lines (122 loc) · 4.34 KB
/
docker-build.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
name: Docker Image build tests
on:
push:
pull_request:
types: [opened, reopened]
jobs:
docker-build-oss:
name: Build ${{ matrix.cassandra-version }} Cassandra Docker image
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
- 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: Build Cassandra ${{ matrix.cassandra-version }}
id: docker_oss_build
uses: docker/build-push-action@v4
with:
file: ${{ matrix.docker-file }}
context: .
push: false
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
target: ${{ matrix.build-target }}
docker-build-dse-ubuntu:
name: Build DSE 6.8 (${{ matrix.jdk-version }}) Ubuntu Docker image
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
- 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: Build DSE 6.8-${{ matrix.jdk-version }}
id: docker_dse_build
uses: docker/build-push-action@v4
with:
file: dse-68/Dockerfile.${{ matrix.jdk-version }}
context: .
push: false
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
target: dse68
# Build UBI image in the same job after the Ubuntu image, only for JDK8
# This currently does not work since you can't build multi-arch images AND
# load them. The UBI images need to have the Ubuntu based images built
# and loaded (or published) before they can proceed.
# - name: Set outputs for DSE UBI image
# if: ${{ matrix.jdk-version == 'jdk8' }}
# id: vars
# run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
# - name: Build DSE UBI image
# if: ${{ matrix.jdk-version == 'jdk8' }}
# id: docker_dse_ubi_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: false
# tags: ${{ steps.meta.outputs.tags }}
# platforms: linux/amd64,linux/arm64
# target: dse68