7
7
branches : [master]
8
8
schedule :
9
9
- cron : ' 0 2 * * *'
10
+ # Allow manually triggering a run in the github ui.
11
+ # See: https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow
12
+ workflow_dispatch : {}
10
13
11
14
env :
12
15
CONTAINER_CMD : docker
13
16
jobs :
14
17
checks :
15
18
runs-on : ubuntu-latest
16
19
steps :
17
- - uses : actions/checkout@v3
20
+ - uses : actions/checkout@v4
18
21
# We need a newer version of shellcheck to avoid problems with the
19
22
# relative imports. Our scripts work on v0.7.2 and up but not the
20
23
# v0.7.0 preinstalled in the ubutnu image. We can force a local
26
29
runs-on : ubuntu-latest
27
30
if : github.event_name == 'pull_request'
28
31
steps :
29
- - uses : actions/checkout@v3
32
+ - uses : actions/checkout@v4
30
33
with :
31
34
fetch-depth : 0
32
35
ref : ${{ github.event.pull_request.head.sha }}
@@ -47,12 +50,16 @@ jobs:
47
50
# there are no nightly packages for opensuse
48
51
- package_source : nightly
49
52
os : opensuse
53
+ include :
54
+ - package_source : devbuilds
55
+ os : centos
56
+ arch : amd64
50
57
runs-on : ubuntu-latest
51
58
env :
52
59
BUILDAH_FORMAT : oci
53
60
IMG_TAG : ${{ matrix.package_source }}-${{ matrix.os }}-${{ matrix.arch }}
54
61
steps :
55
- - uses : actions/checkout@v3
62
+ - uses : actions/checkout@v4
56
63
- name : Build the server image
57
64
run : make KIND=server PACKAGE_SOURCE=${{ matrix.package_source }} OS_NAME=${{ matrix.os}} BUILD_ARCH=${{ matrix.arch}} build-image
58
65
- name : Upload server image
80
87
BUILDAH_FORMAT : oci
81
88
IMG_TAG : ${{ matrix.package_source }}-${{ matrix.os }}-${{ matrix.arch }}
82
89
steps :
83
- - uses : actions/checkout@v3
90
+ - uses : actions/checkout@v4
84
91
- name : Build the ad server image
85
92
run : make KIND=ad-server PACKAGE_SOURCE=${{ matrix.package_source }} OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-image
86
93
- name : Upload ad server image
@@ -100,11 +107,10 @@ jobs:
100
107
BUILDAH_FORMAT : oci
101
108
IMG_TAG : default-${{ matrix.os }}-${{ matrix.arch }}
102
109
steps :
103
- - uses : actions/checkout@v3
110
+ - uses : actions/checkout@v4
104
111
- name : build the client image
105
112
run : make KIND=client OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-image
106
- # Here we upload samba-client image to artifacts locally for consumption
107
- # during the samba-toolbox build process.
113
+ # The client image is used as a base for the samba-toolbox build process.
108
114
- name : Upload the client image
109
115
110
116
with :
@@ -123,7 +129,7 @@ jobs:
123
129
BUILDAH_FORMAT : oci
124
130
IMG_TAG : default-${{ matrix.os }}-${{ matrix.arch }}
125
131
steps :
126
- - uses : actions/checkout@v3
132
+ - uses : actions/checkout@v4
127
133
# Download locally stored samba-client image to be used as base for building
128
134
# samba-toolbox.
129
135
- name : Download client image
@@ -139,6 +145,13 @@ jobs:
139
145
run : ${{ env.CONTAINER_CMD }} tag samba-client:${{ env.IMG_TAG }} quay.io/samba.org/samba-client:latest
140
146
- name : Build the toolbox image
141
147
run : make KIND=toolbox OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-image
148
+ # Upload the toolbox image for reference and/or image push
149
+ - name : Upload the toolbox image
150
+
151
+ with :
152
+ image : " samba-toolbox:${{ env.IMG_TAG }}"
153
+ container_engine : ${{ env.CONTAINER_CMD }}
154
+ retention_days : 1
142
155
143
156
test-server :
144
157
strategy :
@@ -150,13 +163,17 @@ jobs:
150
163
# there are no nightly packages for opensuse
151
164
- package_source : nightly
152
165
os : opensuse
166
+ include :
167
+ - package_source : devbuilds
168
+ os : centos
169
+ arch : amd64
153
170
needs : build-server
154
171
runs-on : ubuntu-latest
155
172
env :
156
173
BUILDAH_FORMAT : oci
157
174
IMG_TAG : ${{ matrix.package_source }}-${{ matrix.os }}-${{ matrix.arch }}
158
175
steps :
159
- - uses : actions/checkout@v3
176
+ - uses : actions/checkout@v4
160
177
- name : Download server image
161
178
162
179
with :
@@ -187,7 +204,7 @@ jobs:
187
204
BUILDAH_FORMAT : oci
188
205
IMG_TAG : ${{ matrix.package_source }}-${{ matrix.os }}-${{ matrix.arch }}
189
206
steps :
190
- - uses : actions/checkout@v3
207
+ - uses : actions/checkout@v4
191
208
- uses : nolar/setup-k3d-k3s@v1
192
209
- name : get nodes
193
210
run : kubectl get nodes
@@ -214,20 +231,87 @@ jobs:
214
231
- test-server
215
232
- test-ad-server-kubernetes
216
233
runs-on : ubuntu-latest
234
+ env :
235
+ REPO_BASE : quay.io/samba.org
217
236
if : (github.event_name == 'push' || github.event_name == 'schedule') && github.repository == 'samba-in-kubernetes/samba-container'
218
237
steps :
219
- - uses : actions/checkout@v3
238
+ - uses : actions/checkout@v4
220
239
- name : log in to quay.io
221
- run : docker login -u "${{ secrets.QUAY_USER }}" -p "${{ secrets.QUAY_PASS }}" quay.io
222
- - name : push server image
223
- run : make push-server
224
- - name : push ad-server image
225
- run : make push-ad-server
226
- - name : push client image
227
- run : make push-client
228
- - name : push toolbox image
229
- run : make push-toolbox
230
- - name : push nightly server image
231
- run : make push-nightly-server
232
- - name : push nightly ad server image
233
- run : make push-nightly-ad-server
240
+ run : ${CONTAINER_CMD} login -u "${{ secrets.QUAY_USER }}" -p "${{ secrets.QUAY_PASS }}" quay.io
241
+ # pull in already built images we plan on pushing
242
+ # (server images)
243
+ - name : Fetch server default-fedora-amd64
244
+
245
+ with :
246
+ image : " samba-server:default-fedora-amd64"
247
+ container_engine : ${{ env.CONTAINER_CMD }}
248
+ - name : Fetch server nightly-fedora-amd64
249
+
250
+ with :
251
+ image : " samba-server:nightly-fedora-amd64"
252
+ container_engine : ${{ env.CONTAINER_CMD }}
253
+ - name : Fetch server nightly-centos-amd64
254
+
255
+ with :
256
+ image : " samba-server:nightly-centos-amd64"
257
+ container_engine : ${{ env.CONTAINER_CMD }}
258
+ - name : Fetch server devbuilds-centos-amd64
259
+
260
+ with :
261
+ image : " samba-server:devbuilds-centos-amd64"
262
+ container_engine : ${{ env.CONTAINER_CMD }}
263
+ # (ad server images)
264
+ - name : Fetch ad-server default-fedora-amd64
265
+
266
+ with :
267
+ image : " samba-ad-server:default-fedora-amd64"
268
+ container_engine : ${{ env.CONTAINER_CMD }}
269
+ - name : Fetch ad-server nightly-fedora-amd64
270
+
271
+ with :
272
+ image : " samba-ad-server:nightly-fedora-amd64"
273
+ container_engine : ${{ env.CONTAINER_CMD }}
274
+ # (client images)
275
+ - name : Fetch client default-fedora-amd64
276
+
277
+ with :
278
+ image : " samba-client:default-fedora-amd64"
279
+ container_engine : ${{ env.CONTAINER_CMD }}
280
+ # (toolbox images)
281
+ - name : Fetch toolbox default-fedora-amd64
282
+
283
+ with :
284
+ image : " samba-toolbox:default-fedora-amd64"
285
+ container_engine : ${{ env.CONTAINER_CMD }}
286
+ # reapply missing tags
287
+ - name : Retag images
288
+ run : >
289
+ ./hack/build-image
290
+ --retag
291
+ --container-engine=${CONTAINER_CMD}
292
+ --repo-base=${REPO_BASE}
293
+ --no-distro-qualified
294
+ -i samba-server:default-fedora-amd64
295
+ -i samba-server:nightly-fedora-amd64
296
+ -i samba-server:nightly-centos-amd64
297
+ -i samba-server:devbuilds-centos-amd64
298
+ -i samba-ad-server:default-fedora-amd64
299
+ -i samba-ad-server:nightly-fedora-amd64
300
+ -i samba-client:default-fedora-amd64
301
+ -i samba-toolbox:default-fedora-amd64
302
+ - name : Push images
303
+ run : >
304
+ ./hack/build-image
305
+ --push
306
+ --container-engine=${CONTAINER_CMD}
307
+ --verbose
308
+ --push-state=exists
309
+ --push-selected-tags=mixed
310
+ -i ${REPO_BASE}/samba-server:default-fedora-amd64
311
+ -i ${REPO_BASE}/samba-server:nightly-fedora-amd64
312
+ -i ${REPO_BASE}/samba-server:nightly-centos-amd64
313
+ -i ${REPO_BASE}/samba-server:devbuilds-centos-amd64
314
+ -i ${REPO_BASE}/samba-ad-server:default-fedora-amd64
315
+ -i ${REPO_BASE}/samba-ad-server:nightly-fedora-amd64
316
+ -i ${REPO_BASE}/samba-client:default-fedora-amd64
317
+ -i ${REPO_BASE}/samba-toolbox:default-fedora-amd64
0 commit comments