diff --git a/.buildkite/hooks/pre-exit b/.buildkite/hooks/pre-exit index d5c6a60ef..803c88a5b 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