Skip to content

Commit a6022f2

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
github: use fqin tagging throughout the CI jobs
Use the newer Fully-Qualified-Image-Name tagging scheme in the github ci actions yaml. This makes the naming of each image better match the core build parameters (kind, package source, distro base (aka OS), and arch). The major build and test targets all get an IMG_TAG env var to help organize and make the rest of the yaml structure consistent. One workaround we need to apply is to the toolbox builds as the FROM line in the dockerfiles don't match FQINs nor do they match the old scheme consistently (see #146). So we just do a little hack in that section alone to get things working correctly. Signed-off-by: John Mulligan <[email protected]>
1 parent 8a631d9 commit a6022f2

File tree

1 file changed

+40
-20
lines changed

1 file changed

+40
-20
lines changed

.github/workflows/container-image.yml

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,15 @@ jobs:
4343
runs-on: ubuntu-latest
4444
env:
4545
BUILDAH_FORMAT: oci
46+
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
4647
steps:
4748
- uses: actions/checkout@v3
4849
- name: Build the server image
4950
run: make KIND=server OS_NAME=${{ matrix.os}} BUILD_ARCH=${{ matrix.arch}} build-image
5051
- name: Upload server image
5152
uses: ishworkh/[email protected]
5253
with:
53-
image: "samba-server:${{ matrix.os }}-latest"
54+
image: "samba-server:${{ env.IMG_TAG }}"
5455
container_engine: ${{ env.CONTAINER_CMD }}
5556
retention_days: 1
5657

@@ -64,14 +65,15 @@ jobs:
6465
runs-on: ubuntu-latest
6566
env:
6667
BUILDAH_FORMAT: oci
68+
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
6769
steps:
6870
- uses: actions/checkout@v3
6971
- name: Build the ad server image
7072
run: make KIND=ad-server OS_NAME=${{matrix.os}} BUILD_ARCH=${{matrix.arch}} build-image
7173
- name: Upload ad server image
7274
uses: ishworkh/[email protected]
7375
with:
74-
image: "samba-ad-server:${{ matrix.os}}-latest"
76+
image: "samba-ad-server:${{ env.IMG_TAG }}"
7577
container_engine: ${{ env.CONTAINER_CMD }}
7678
retention_days: 1
7779

@@ -83,6 +85,7 @@ jobs:
8385
runs-on: ubuntu-latest
8486
env:
8587
BUILDAH_FORMAT: oci
88+
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
8689
steps:
8790
- uses: actions/checkout@v3
8891
- name: build the client image
@@ -92,7 +95,7 @@ jobs:
9295
- name: Upload the client image
9396
uses: ishworkh/[email protected]
9497
with:
95-
image: "quay.io/samba.org/samba-client:${{ matrix.os }}-latest"
98+
image: "samba-client:${{ env.IMG_TAG }}"
9699
container_engine: ${{ env.CONTAINER_CMD }}
97100
retention_days: 1
98101

@@ -105,15 +108,22 @@ jobs:
105108
runs-on: ubuntu-latest
106109
env:
107110
BUILDAH_FORMAT: oci
111+
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
108112
steps:
109113
- uses: actions/checkout@v3
110114
# Download locally stored samba-client image to be used as base for building
111115
# samba-toolbox.
112116
- name: Download client image
113117
uses: ishworkh/[email protected]
114118
with:
115-
image: "quay.io/samba.org/samba-client:${{ matrix.os }}-latest"
119+
image: "samba-client:${{ env.IMG_TAG }}"
116120
container_engine: ${{ env.CONTAINER_CMD }}
121+
# Workaround: retag the image so that the FQIN image matches the name in
122+
# the toolbox containerfiles.
123+
- name: Apply OS-latest tag to image (for centos)
124+
run: ${{ env.CONTAINER_CMD }} tag samba-client:${{ env.IMG_TAG }} quay.io/samba.org/samba-client:${{ matrix.os }}-latest
125+
- name: Apply latest tag to image (for fedora)
126+
run: ${{ env.CONTAINER_CMD }} tag samba-client:${{ env.IMG_TAG }} quay.io/samba.org/samba-client:latest
117127
- name: Build the toolbox image
118128
run: make KIND=toolbox OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-image
119129

@@ -124,15 +134,18 @@ jobs:
124134
arch: [amd64]
125135
needs: build-server
126136
runs-on: ubuntu-latest
137+
env:
138+
BUILDAH_FORMAT: oci
139+
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
127140
steps:
128141
- uses: actions/checkout@v3
129142
- name: Download server image
130143
uses: ishworkh/[email protected]
131144
with:
132-
image: "samba-server:${{ matrix.os }}-latest"
145+
image: "samba-server:${{ env.IMG_TAG }}"
133146
container_engine: ${{ env.CONTAINER_CMD }}
134147
- name: Test the server image
135-
run: LOCAL_TAG="samba-server:${{ matrix.os}}-latest" tests/test-samba-container.sh
148+
run: LOCAL_TAG=samba-server:${{ env.IMG_TAG }} tests/test-samba-container.sh
136149

137150
# Reminder: the nightly-server images consume nightly samba rpm builds
138151
# it is not *just* an image that gets built nightly
@@ -144,14 +157,15 @@ jobs:
144157
runs-on: ubuntu-latest
145158
env:
146159
BUILDAH_FORMAT: oci
160+
IMG_TAG: nightly-${{ matrix.os }}-${{ matrix.arch }}
147161
steps:
148162
- uses: actions/checkout@v3
149163
- name: Build the nightly server image
150164
run: make KIND=server PACKAGE_SOURCE=nightly OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-image
151165
- name: Upload nightly server image
152166
uses: ishworkh/[email protected]
153167
with:
154-
image: "samba-server:${{ matrix.os }}-nightly"
168+
image: "samba-server:${{ env.IMG_TAG }}"
155169
container_engine: ${{ env.CONTAINER_CMD }}
156170
retention_days: 1
157171

@@ -163,14 +177,15 @@ jobs:
163177
runs-on: ubuntu-latest
164178
env:
165179
BUILDAH_FORMAT: oci
180+
IMG_TAG: nightly-${{ matrix.os }}-${{ matrix.arch }}
166181
steps:
167182
- uses: actions/checkout@v3
168183
- name: Build the nightly ad server image
169184
run: make KIND=ad-server PACKAGE_SOURCE=nightly OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-image
170185
- name: Upload nightly AD server image
171186
uses: ishworkh/[email protected]
172187
with:
173-
image: "samba-ad-server:${{ matrix.os }}-nightly"
188+
image: "samba-ad-server:${{ env.IMG_TAG }}"
174189
container_engine: ${{ env.CONTAINER_CMD }}
175190
retention_days: 1
176191

@@ -181,15 +196,18 @@ jobs:
181196
arch: [amd64]
182197
needs: build-nightly-server
183198
runs-on: ubuntu-latest
199+
env:
200+
BUILDAH_FORMAT: oci
201+
IMG_TAG: nightly-${{ matrix.os }}-${{ matrix.arch }}
184202
steps:
185203
- uses: actions/checkout@v3
186204
- name: Download nightly server image
187205
uses: ishworkh/[email protected]
188206
with:
189-
image: "samba-server:${{ matrix.os }}-nightly"
207+
image: "samba-server:${{ env.IMG_TAG }}"
190208
container_engine: ${{ env.CONTAINER_CMD }}
191209
- name: Test the nightly server image
192-
run: LOCAL_TAG=samba-server:${{ matrix.os }}-nightly tests/test-samba-container.sh
210+
run: LOCAL_TAG=samba-server:${{ env.IMG_TAG }} tests/test-samba-container.sh
193211

194212
test-ad-server-kubernetes:
195213
strategy:
@@ -204,7 +222,8 @@ jobs:
204222
# need to explicitly use 20.04 to avoid problems with jq...
205223
runs-on: ubuntu-20.04
206224
env:
207-
IMG_TAG: ${{ matrix.os }}-latest
225+
BUILDAH_FORMAT: oci
226+
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
208227
steps:
209228
- uses: actions/checkout@v3
210229
- uses: nolar/setup-k3d-k3s@v1
@@ -213,17 +232,17 @@ jobs:
213232
- name: Download ad server image
214233
uses: ishworkh/[email protected]
215234
with:
216-
image: "samba-ad-server:${{ matrix.os }}-latest"
235+
image: "samba-ad-server:${{ env.IMG_TAG }}"
217236
container_engine: ${{ env.CONTAINER_CMD }}
218237
- name: import ad server image
219-
run: k3d image import samba-ad-server:${{ matrix.os }}-latest
238+
run: k3d image import samba-ad-server:${{ env.IMG_TAG }}
220239
- name: Download file server image
221240
uses: ishworkh/[email protected]
222241
with:
223-
image: "samba-server:${{ matrix.os }}-latest"
242+
image: "samba-server:${{ env.IMG_TAG }}"
224243
container_engine: ${{ env.CONTAINER_CMD }}
225244
- name: import file server image
226-
run: k3d image import samba-server:${{ matrix.os }}-latest
245+
run: k3d image import samba-server:${{ env.IMG_TAG }}
227246
- name: run the ad-dc deployment test
228247
run: ./tests/test-samba-ad-server-kubernetes.sh
229248

@@ -238,7 +257,8 @@ jobs:
238257
# need to explicitly use 20.04 to avoid problems with jq...
239258
runs-on: ubuntu-20.04
240259
env:
241-
IMG_TAG: ${{ matrix.os }}-nightly
260+
BUILDAH_FORMAT: oci
261+
IMG_TAG: nightly-${{ matrix.os }}-${{ matrix.arch }}
242262
steps:
243263
- uses: actions/checkout@v3
244264
- uses: nolar/setup-k3d-k3s@v1
@@ -247,17 +267,17 @@ jobs:
247267
- name: Download nightly ad server image
248268
uses: ishworkh/[email protected]
249269
with:
250-
image: "samba-ad-server:${{ matrix.os }}-nightly"
270+
image: "samba-ad-server:${{ env.IMG_TAG }}"
251271
container_engine: ${{ env.CONTAINER_CMD }}
252272
- name: import nightly ad server image
253-
run: k3d image import samba-ad-server:${{ matrix.os }}-nightly
273+
run: k3d image import samba-ad-server:${{ env.IMG_TAG }}
254274
- name: Download nightly file server image
255275
uses: ishworkh/[email protected]
256276
with:
257-
image: "samba-server:${{ matrix.os }}-nightly"
277+
image: "samba-server:${{ env.IMG_TAG }}"
258278
container_engine: ${{ env.CONTAINER_CMD }}
259279
- name: import nightly file server image
260-
run: k3d image import samba-server:${{ matrix.os }}-nightly
280+
run: k3d image import samba-server:${{ env.IMG_TAG }}
261281
- name: run the ad-dc deployment test
262282
run: ./tests/test-samba-ad-server-kubernetes.sh
263283

0 commit comments

Comments
 (0)