mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:11:48 +00:00
ci: use array for running containers in preexit (#56059)
* grab some more verbose logging for exit hook * use array
This commit is contained in:
parent
f7a34cbbad
commit
f7ed60bf61
@ -17,7 +17,9 @@ if [[ "$BUILDKITE_AGENT_META_DATA_QUEUE" == "bazel" ]]; then
|
||||
|
||||
# Remove any hanging containers and/or volumes to ensure the next tests are able to run.
|
||||
if [[ $(docker ps -aq | wc -l) -gt 0 ]]; then
|
||||
docker rm -f "$(docker ps -aq)"
|
||||
echo "Removing docker containers..."
|
||||
mapfile -t containers < <(docker ps -aq)
|
||||
for c in "${containers[@]}"; do docker rm -f "$c"; done
|
||||
fi
|
||||
if [[ $(docker volume ls -q) -gt 0 ]]; then
|
||||
docker volume rm "$(docker volume ls -q)"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user