summaryrefslogtreecommitdiffhomepage
path: root/.buildkite/hooks/post-command
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2021-02-01 16:59:01 -0800
committergVisor bot <gvisor-bot@google.com>2021-02-01 17:00:58 -0800
commit5d8054e75a9ce2a4ee3feeb0a6d284967ff3ba46 (patch)
tree644340ed66abffae1298540668d0cb5037e78bdf /.buildkite/hooks/post-command
parent5230c8e13c5db572615403b4f0bc576c2ec08087 (diff)
Remove Go cache on failure.
It's unclear why permissions wind up corrupted, but these can be cleared on any failure, similar to the bazel cache itself: https://buildkite.com/gvisor/pipeline/builds/2304#_ PiperOrigin-RevId: 355057421
Diffstat (limited to '.buildkite/hooks/post-command')
-rw-r--r--.buildkite/hooks/post-command3
1 files changed, 3 insertions, 0 deletions
diff --git a/.buildkite/hooks/post-command b/.buildkite/hooks/post-command
index 8af1369a6..c4c6fc90c 100644
--- a/.buildkite/hooks/post-command
+++ b/.buildkite/hooks/post-command
@@ -51,6 +51,9 @@ if test "${BUILDKITE_COMMAND_EXIT_STATUS}" -ne "0"; then
# Attempt to clear the cache and shut down.
make clean || echo "make clean failed with code $?"
make bazel-shutdown || echo "make bazel-shutdown failed with code $?"
+ # Attempt to clear any Go cache.
+ sudo rm -rf "${HOME}/.cache/go-build"
+ sudo rm -rf "${HOME}/go"
fi
# Kill any running containers (clear state).