From 10cea0b22d48e79966aa3cc567852d76fb4662e8 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 27 Jul 2019 11:31:09 -0400 Subject: [PATCH] Don't try to push images when the build failed When an image build fails we're still trying to push the image to the registry. This isn't going to work, as there is no image to push since the build failed. Add a check for the job being in a success state for if we're pushing images. This way we can properly report FAILURE instead of POST_FAILURE. Change-Id: Idba5c8997111c6e84b44bc970394b58387519666 --- roles/push-to-intermediate-registry/tasks/main.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/push-to-intermediate-registry/tasks/main.yaml b/roles/push-to-intermediate-registry/tasks/main.yaml index 0d991a08a..5bf1baabf 100644 --- a/roles/push-to-intermediate-registry/tasks/main.yaml +++ b/roles/push-to-intermediate-registry/tasks/main.yaml @@ -1,3 +1,5 @@ - name: Push images to intermediate registry - when: docker_images is defined + when: + - docker_images is defined + - zuul_success | default(true) | bool include_tasks: push.yaml