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.
This commit is contained in:
Amir Zarrinkafsh 2022-03-30 11:24:50 +11:00 committed by GitHub
parent 160a087af5
commit 8ba586e955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,8 @@
set +u 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" echo "--- :docker: Clean environment"
docker system prune -af --volumes docker system prune -af --volumes
fi fi