From 3de1827b21413c6504ac140087cc1b0cb9175bcd Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Thu, 9 Apr 2020 14:46:04 +1000 Subject: [PATCH] [Buildkite] Control clean builds with agent metadata (#840) This is to optimise build times at the sacrifice of disk space/clean up tasks. --- .buildkite/hooks/pre-exit | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.buildkite/hooks/pre-exit b/.buildkite/hooks/pre-exit index 6a1767f98..8224e4146 100755 --- a/.buildkite/hooks/pre-exit +++ b/.buildkite/hooks/pre-exit @@ -2,5 +2,7 @@ set +u -echo "--- :docker: Clean environment" -docker system prune -af --volumes \ No newline at end of file +if [[ $BUILDKITE_AGENT_META_DATA_CLEANBUILD != "false" ]]; then + echo "--- :docker: Clean environment" + docker system prune -af --volumes +fi \ No newline at end of file