From 67c382b5f0aec53ea8131f12b7d89728065d2b47 Mon Sep 17 00:00:00 2001 From: Zach Loafman Date: Fri, 30 Jan 2015 13:50:07 -0800 Subject: [PATCH] Clean out dead docker containers and docker images every Jenkins build This will increase build times on Jenkins, but should make the build times consistent and make them pull from sources every time versus leftover artifacts. Also upping timeout. (Try to address recent some aborted builds.) --- hack/jenkins/build.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hack/jenkins/build.sh b/hack/jenkins/build.sh index 65e41482710..f9bc4a63f30 100755 --- a/hack/jenkins/build.sh +++ b/hack/jenkins/build.sh @@ -34,16 +34,15 @@ export PATH=$PATH:/usr/local/go/bin export KUBE_RELEASE_RUN_TESTS=n export KUBE_SKIP_CONFIRMATIONS=y -# Clean stuff out. -# -# TODO: Look at git clean plugin again for hermeticism, but may not -# play nicely with dockerized stuff and permissions. (We may just need -# to force the build/make-clean.sh at the end of the build regardless -# of status and be delicate with the exit status.) (Low priority -# unless there's a hermetic issue.) +# Clean stuff out. Assume the worst - the last build may have left the +# tree in an odd state. There's a Jenkins git clean plugin, but we +# have the docker images to worry about as well, so be really pedantic +# about cleaning. rm -rf ~/.kube* -./build/make-clean.sh +make clean git clean -fdx +docker ps -aq | xargs -r docker rm +docker images -q | xargs -r docker rmi # Build go run ./hack/e2e.go -v --build