From 8ba586e955d027df8bf22304eaa3d53eaee1bfd3 Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Wed, 30 Mar 2022 11:24:50 +1100 Subject: [PATCH] ci(buildkite): prevent pre-exit hook on setup steps (#3076) * ci(buildkite): prevent pre-exit hook on setup steps Occasionally due to node issues the pre-exit hook for docker image cleanups can fail, causing the otherwise successful job to bail out. This change ignores the cleanup on setup steps. --- .buildkite/hooks/pre-exit | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.buildkite/hooks/pre-exit b/.buildkite/hooks/pre-exit index d5c6a60e..803c88a5 100755 --- a/.buildkite/hooks/pre-exit +++ b/.buildkite/hooks/pre-exit @@ -2,7 +2,8 @@ set +u -if [[ "${BUILDKITE_AGENT_META_DATA_CLEANBUILD}" != "false" ]]; then +if [[ ! "${BUILDKITE_COMMAND}" =~ "buildkite-agent pipeline upload" ]] && \ +[[ "${BUILDKITE_AGENT_META_DATA_CLEANBUILD}" != "false" ]]; then echo "--- :docker: Clean environment" docker system prune -af --volumes fi \ No newline at end of file