-
Notifications
You must be signed in to change notification settings - Fork 1.2k
210 lines (202 loc) · 7.27 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
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
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Docker Build
on:
workflow_dispatch:
inputs:
version:
description: 'dinky version'
required: true
jobs:
build_releases:
name: build releases
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# maven编译
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: 'adopt'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: |
~/.m2/repository/*/*/*
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# - name: Check Style
# run: |
# ./mvnw -T 4C -B --no-snapshot-updates clean spotless:check
- name: Build and Package
run: |
./mvnw -B clean install \
-Dmaven.test.skip=true \
-Dspotless.check.skip=true \
-P prod,scala-2.12,flink-all,web,maven-central,fast \
--no-snapshot-updates
- name: Upload release file
uses: actions/upload-artifact@v3
with:
name: release-file
path: ./build/dinky-release-*.tar.gz
dinky_mysql_image:
name: dinky mysql image
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
url: [ registry.cn-hangzhou.aliyuncs.com ,docker.io ]
include:
- url: registry.cn-hangzhou.aliyuncs.com
namespace: dinky
- url: docker.io
namespace: dinkydocker
steps:
- uses: actions/checkout@v3
- name: Log in to the Container registry,url -> ${{ matrix.url }}
if: ${{ matrix.url == 'registry.cn-hangzhou.aliyuncs.com'}}
uses: docker/login-action@v2
with:
registry: ${{ matrix.url }}
username: ${{ secrets.DOCKER_ALIYUN_USER }}
password: ${{ secrets.DOCKER_ALIYUN_PASS }}
- name: Log in to the Container registry,url -> ${{ matrix.url }}
if: ${{ matrix.url == 'docker.io'}}
uses: docker/login-action@v2
with:
registry: ${{ matrix.url }}
username: ${{ secrets.DOCKER_IO_USER }}
password: ${{ secrets.DOCKER_IO_PASS }}
- name: push docker dinky mysql image
uses: docker/build-push-action@v2
with:
file: docker/DockerfileMysql
context: .
push: true
tags: ${{ matrix.url }}/${{ matrix.namespace }}/dinky-mysql-server:${{ inputs.version }}
dinky_image:
name: docker dinky image
runs-on: ubuntu-latest
needs: [build_releases]
strategy:
fail-fast: true
matrix:
url: [ registry.cn-hangzhou.aliyuncs.com ,docker.io ]
include:
- url: registry.cn-hangzhou.aliyuncs.com
namespace: dinky
- url: docker.io
namespace: dinkydocker
steps:
- uses: actions/checkout@v3
- name: Move Dockerfile
run: |
cp -r ./docker/Dockerfile* ./
- name: Download math result for job 1
uses: actions/download-artifact@v3
with:
name: release-file
path: ./build/
- name: Log in to the Container registry,url -> ${{ matrix.url }}
if: ${{ matrix.url == 'registry.cn-hangzhou.aliyuncs.com'}}
uses: docker/login-action@v2
with:
registry: ${{ matrix.url }}
username: ${{ secrets.DOCKER_ALIYUN_USER }}
password: ${{ secrets.DOCKER_ALIYUN_PASS }}
- name: Log in to the Container registry,url -> ${{ matrix.url }}
if: ${{ matrix.url == 'docker.io'}}
uses: docker/login-action@v2
with:
registry: ${{ matrix.url }}
username: ${{ secrets.DOCKER_IO_USER }}
password: ${{ secrets.DOCKER_IO_PASS }}
- name: push docker dinky image
uses: docker/build-push-action@v2
with:
build-args: |
DINKY_VERSION=${{ inputs.version }}
file: Dockerfile
context: .
push: true
tags: ${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }}
dinky_flink_image:
name: docker dinky flink image
runs-on: ubuntu-latest
needs: [ dinky_image ]
strategy:
fail-fast: true
matrix:
url: [ registry.cn-hangzhou.aliyuncs.com ,docker.io ]
FLINK_VERSION: [1.14.6 , 1.15.2 , 1.16.0, 1.17.0, 1.18.0]
include:
- url: registry.cn-hangzhou.aliyuncs.com
namespace: dinky
- url: docker.io
namespace: dinkydocker
- FLINK_VERSION: 1.14.6
FLINK_BIG_VERSION: 1.14
- FLINK_VERSION: 1.15.4
FLINK_BIG_VERSION: 1.15
- FLINK_VERSION: 1.16.2
FLINK_BIG_VERSION: 1.16
- FLINK_VERSION : 1.17.1
FLINK_BIG_VERSION: 1.17
- FLINK_VERSION: 1.18.0
FLINK_BIG_VERSION: 1.18
steps:
- uses: actions/checkout@v3
- name: Move Dockerfile
run: |
cp -r ./docker/Dockerfile* ./
- uses: actions/checkout@v3
- name: set the flink_big_version
run: |
echo FLINK_BIG_VERSION=${FLINK_VERSION%.*} >> $GITHUB_ENV
- name: Download math result for job 1
uses: actions/download-artifact@v3
with:
name: release-file
path: ./build/
- name: Log in to the Container registry,url -> ${{ matrix.url }}
if: ${{ matrix.url == 'registry.cn-hangzhou.aliyuncs.com'}}
uses: docker/login-action@v2
with:
registry: ${{ matrix.url }}
username: ${{ secrets.DOCKER_ALIYUN_USER }}
password: ${{ secrets.DOCKER_ALIYUN_PASS }}
- name: Log in to the Container registry,url -> ${{ matrix.url }}
if: ${{ matrix.url == 'docker.io'}}
uses: docker/login-action@v2
with:
registry: ${{ matrix.url }}
username: ${{ secrets.DOCKER_IO_USER }}
password: ${{ secrets.DOCKER_IO_PASS }}
- name: push docker dinky image
uses: docker/build-push-action@v2
with:
build-args: |
FLINK_VERSION=${{ matrix.FLINK_VERSION }}
DINKY_IMAGE=${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }}
FLINK_BIG_VERSION=${{ matrix.FLINK_BIG_VERSION }}
file: DockerfileDinkyFlink
context: .
push: true
tags: ${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }}-flink-${{matrix.FLINK_BIG_VERSION }}