Skip to content

Commit eac3454

Browse files
committed
Fail container build workflow when no images build
1 parent a928af7 commit eac3454

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/stackhpc-container-image-build.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ jobs:
167167
env:
168168
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
169169

170+
- name: Prune local Kolla container images over 1 week old
171+
run: |
172+
sudo docker image prune --all --force --filter until=168h --filter="label=kolla_version"
173+
170174
- name: Build and push kolla overcloud images
171175
run: |
172176
args="${{ github.event.inputs.regexes }}"
@@ -200,17 +204,16 @@ jobs:
200204
run: |
201205
sudo docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/${{ matrix.distro }}-*:${{ needs.generate-tag.outputs.kolla_tag }}" > ${{ matrix.distro }}-container-images
202206
207+
- name: Fail if no images have been built
208+
run: if [ $(wc -l < ${{ matrix.distro }}-container-images) -le 1 ]; then exit 1; fi
209+
203210
- name: Upload container images artifact
204211
uses: actions/upload-artifact@v3
205212
with:
206213
name: ${{ matrix.distro }} container images
207214
path: ${{ matrix.distro }}-container-images
208215
retention-days: 7
209216

210-
- name: Prune local Kolla container images over 1 week old
211-
run: |
212-
sudo docker image prune --all --force --filter until=168h --filter="label=kolla_version"
213-
214217
sync-container-repositories:
215218
name: Trigger container image repository sync
216219
needs:

0 commit comments

Comments
 (0)