From cb91f9957f56baee3d19a8dc1ed7c6ca5eba6368 Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Mon, 3 Apr 2017 20:09:07 -0700 Subject: [PATCH] [infra] Ugly hack to save disk space after a build. --- infra/gcb/build.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/infra/gcb/build.py b/infra/gcb/build.py index 9a1bfbb99..f42d726e0 100755 --- a/infra/gcb/build.py +++ b/infra/gcb/build.py @@ -156,7 +156,9 @@ def get_build_steps(project_yaml): '-c', # Remove /out to break loudly when a build script incorrectly uses # /out instead of $OUT. - 'rm -r /out && cd /src/{1} && mkdir -p {0} && compile'.format(out, name), + # We also remove /work and /src to save disk space after a step. + # Container Builder doesn't pass --rm to docker run yet. + 'rm -r /out && cd /src/{1} && mkdir -p {0} && compile && rm -rf /work && rm -rf /src'.format(out, name), ], }, # zip binaries