77 branches : [master]
88 schedule :
99 - 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 : {}
1013
1114env :
1215 CONTAINER_CMD : docker
1316jobs :
1417 checks :
1518 runs-on : ubuntu-latest
1619 steps :
17- - uses : actions/checkout@v3
20+ - uses : actions/checkout@v4
1821 # We need a newer version of shellcheck to avoid problems with the
1922 # relative imports. Our scripts work on v0.7.2 and up but not the
2023 # v0.7.0 preinstalled in the ubutnu image. We can force a local
2629 runs-on : ubuntu-latest
2730 if : github.event_name == 'pull_request'
2831 steps :
29- - uses : actions/checkout@v3
32+ - uses : actions/checkout@v4
3033 with :
3134 fetch-depth : 0
3235 ref : ${{ github.event.pull_request.head.sha }}
@@ -47,12 +50,16 @@ jobs:
4750 # there are no nightly packages for opensuse
4851 - package_source : nightly
4952 os : opensuse
53+ include :
54+ - package_source : devbuilds
55+ os : centos
56+ arch : amd64
5057 runs-on : ubuntu-latest
5158 env :
5259 BUILDAH_FORMAT : oci
5360 IMG_TAG : ${{ matrix.package_source }}-${{ matrix.os }}-${{ matrix.arch }}
5461 steps :
55- - uses : actions/checkout@v3
62+ - uses : actions/checkout@v4
5663 - name : Build the server image
5764 run : make KIND=server PACKAGE_SOURCE=${{ matrix.package_source }} OS_NAME=${{ matrix.os}} BUILD_ARCH=${{ matrix.arch}} build-image
5865 - name : Upload server image
8087 BUILDAH_FORMAT : oci
8188 IMG_TAG : ${{ matrix.package_source }}-${{ matrix.os }}-${{ matrix.arch }}
8289 steps :
83- - uses : actions/checkout@v3
90+ - uses : actions/checkout@v4
8491 - name : Build the ad server image
8592 run : make KIND=ad-server PACKAGE_SOURCE=${{ matrix.package_source }} OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-image
8693 - name : Upload ad server image
@@ -100,11 +107,10 @@ jobs:
100107 BUILDAH_FORMAT : oci
101108 IMG_TAG : default-${{ matrix.os }}-${{ matrix.arch }}
102109 steps :
103- - uses : actions/checkout@v3
110+ - uses : actions/checkout@v4
104111 - name : build the client image
105112 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.
108114 - name : Upload the client image
109115110116 with :
@@ -123,7 +129,7 @@ jobs:
123129 BUILDAH_FORMAT : oci
124130 IMG_TAG : default-${{ matrix.os }}-${{ matrix.arch }}
125131 steps :
126- - uses : actions/checkout@v3
132+ - uses : actions/checkout@v4
127133 # Download locally stored samba-client image to be used as base for building
128134 # samba-toolbox.
129135 - name : Download client image
@@ -139,6 +145,13 @@ jobs:
139145 run : ${{ env.CONTAINER_CMD }} tag samba-client:${{ env.IMG_TAG }} quay.io/samba.org/samba-client:latest
140146 - name : Build the toolbox image
141147 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
142155
143156 test-server :
144157 strategy :
@@ -150,13 +163,17 @@ jobs:
150163 # there are no nightly packages for opensuse
151164 - package_source : nightly
152165 os : opensuse
166+ include :
167+ - package_source : devbuilds
168+ os : centos
169+ arch : amd64
153170 needs : build-server
154171 runs-on : ubuntu-latest
155172 env :
156173 BUILDAH_FORMAT : oci
157174 IMG_TAG : ${{ matrix.package_source }}-${{ matrix.os }}-${{ matrix.arch }}
158175 steps :
159- - uses : actions/checkout@v3
176+ - uses : actions/checkout@v4
160177 - name : Download server image
161178162179 with :
@@ -187,7 +204,7 @@ jobs:
187204 BUILDAH_FORMAT : oci
188205 IMG_TAG : ${{ matrix.package_source }}-${{ matrix.os }}-${{ matrix.arch }}
189206 steps :
190- - uses : actions/checkout@v3
207+ - uses : actions/checkout@v4
191208 - uses : nolar/setup-k3d-k3s@v1
192209 - name : get nodes
193210 run : kubectl get nodes
@@ -214,20 +231,87 @@ jobs:
214231 - test-server
215232 - test-ad-server-kubernetes
216233 runs-on : ubuntu-latest
234+ env :
235+ REPO_BASE : quay.io/samba.org
217236 if : (github.event_name == 'push' || github.event_name == 'schedule') && github.repository == 'samba-in-kubernetes/samba-container'
218237 steps :
219- - uses : actions/checkout@v3
238+ - uses : actions/checkout@v4
220239 - 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