Skip to content

Commit 823411d

Browse files
committed
Kolla image build - improve output formatting
1 parent c032f68 commit 823411d

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,31 +213,33 @@ jobs:
213213
if: inputs.seed
214214

215215
- name: Get built container images
216-
run: |
217-
docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/${{ matrix.distro }}-*:${{ needs.generate-tag.outputs.kolla_tag }}" > ${{ matrix.distro }}-container-images
216+
run: docker image ls --filter "reference=ark.stackhpc.com/stackhpc-dev/${{ matrix.distro }}-*:${{ needs.generate-tag.outputs.kolla_tag }}" > ${{ matrix.distro }}-container-images
218217

219218
- name: Fail if no images have been built
220219
run: if [ $(wc -l < ${{ matrix.distro }}-container-images) -le 1 ]; then exit 1; fi
221220

222221
- name: Scan built container images
223-
run: |
224-
src/kayobe-config/tools/scan-images.sh ${{ matrix.distro }} ${{ needs.generate-tag.outputs.kolla_tag }}
222+
run: src/kayobe-config/tools/scan-images.sh ${{ matrix.distro }} ${{ needs.generate-tag.outputs.kolla_tag }}
223+
224+
- name: Move image scan logs to output artifact
225+
run: mv image-scan-output image-build-logs/image-scan-output
225226

226227
- name: Fail if no images have passed scanning
227-
run: if [ $(wc -l < image-scan-output/clean-images.txt) -le 0 ]; then exit 1; fi
228+
run: if [ $(wc -l < image-build-logs/image-scan-output/clean-images.txt) -le 0 ]; then exit 1; fi
228229
if: ${{ !inputs.push-dirty }}
229230

230231
- name: Copy clean images to push-attempt-images list
231-
run: cp image-scan-output/clean-images.txt image-scan-output/push-attempt-images.txt
232+
run: cp image-build-logs/image-scan-output/clean-images.txt image-build-logs/push-attempt-images.txt
233+
if: inputs.push
232234

233235
- name: Append dirty images to push list
234236
run: |
235-
cat image-scan-output/dirty-images.txt >> image-scan-output/push-attempt-images.txt
236-
if: inputs.push-dirty
237+
cat image-build-logs/image-scan-output/dirty-images.txt >> image-build-logs/push-attempt-images.txt
238+
if: ${{ inputs.push && inputs.push-dirty }}
237239

238240
- name: Push images
239241
run: |
240-
touch image-scan-output/push-failed-images.txt
242+
touch image-build-logs/push-failed-images.txt
241243
source venvs/kayobe/bin/activate &&
242244
source src/kayobe-config/kayobe-env --environment ci-builder &&
243245
kayobe playbook run ${KAYOBE_CONFIG_PATH}/ansible/docker-registry-login.yml &&
@@ -250,14 +252,13 @@ jobs:
250252
break
251253
elif $i == 5; then
252254
echo "Failed to push $image"
253-
echo $image >> image-scan-output/push-failed-images.txt
255+
echo $image >> image-build-logs/push-failed-images.txt
254256
else
255257
echo "Failed on retry $i"
256258
sleep 5
257259
fi;
258260
done
259-
done < image-scan-output/push-attempt-images.txt &&
260-
mv image-scan-output image-build-logs/image-scan-output
261+
done < image-build-logs/push-attempt-images.txt
261262
shell: bash
262263
env:
263264
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}

0 commit comments

Comments
 (0)