Skip to content

Commit

Permalink
Improve buildkite test_containers.sh by not erroring if docker rm/rmi…
Browse files Browse the repository at this point in the history
… --fail (#1016)

* Improve buildkite test_containers.sh by not erroring if docker rm/rmi fail

* Docker build should be --no-cache in buildkite and circleci
  • Loading branch information
rfay committed Jul 30, 2018
1 parent 4466584 commit 9f5eca4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .buildkite/test_containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
set -o errexit
set -o pipefail
set -o nounset
set -x

function cleanup {
set +x
echo "--- Cleanup docker"
echo "Warning: deleting all docker containers and deleting images that match this build."
if [ "$(docker ps -aq | wc -l)" -gt 0 ] ; then
docker rm -f $(docker ps -aq)
docker rm -f $(docker ps -aq) >/dev/null || true
fi

# Make sure we don't have any existing containers on the testbot that might
# result in this container not being built from scratch.
VERSION=$(make version | sed 's/^VERSION://')
IMAGES=$(docker images | awk "/$VERSION/ { print \$3 }")
if [ ! -z "${IMAGES:-}" ] ; then
docker rmi --force $IMAGES
docker rmi --force $IMAGES 2>&1 >/dev/null || true
fi
}

Expand All @@ -33,11 +33,12 @@ cleanup
# Our testbot should now be sane, run the testbot checker to make sure.
./.buildkite/sanetestbot.sh

set -x

for dir in containers/*
do pushd $dir
echo "--- Build container $dir"
time make container
time make container DOCKER_ARGS=--no-cache
echo "--- Test container $dir"
time make test
popd
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
- run:
command: |
make -f nightly_build.mak clean # Remove any existing binaries
make -f nightly_build.mak -s --print-directory
make -f nightly_build.mak -s --print-directory DOCKER_ARGS=--no-cache
no_output_timeout: "40m"
name: Full nightly build and test with containers

Expand Down

0 comments on commit 9f5eca4

Please sign in to comment.