Skip to content

Commit

Permalink
ci: only kill containers that are based on the solanalabs/rust* images
Browse files Browse the repository at this point in the history
  • Loading branch information
yihau committed Jun 27, 2023
1 parent 6f72258 commit 02b9720
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .buildkite/hooks/post-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ source ci/env.sh
# previous CI job
#
(
containers=$(docker ps -q)
if [[ $(hostname) != metrics-main && $(hostname) != metrics-internal && -n $containers ]]; then
echo "+++ Killing stale docker containers"
docker ps
echo "+++ Killing stale docker containers"
while read -r line; do
id="$(echo "$line" | awk '{print $1}')"
image="$(echo "$line" | awk '{print $2}')"

# shellcheck disable=SC2086 # Don't want to double quote $containers
docker kill $containers
fi
if [[ $image == *"solanalabs/rust"* ]]; then
if docker kill "$id" >/dev/null; then
echo "kill $id $image"
fi
continue
fi
done < <(docker ps | tail -n +2)
)

# Processes from previously aborted CI jobs seem to loiter, unclear why as one
Expand Down

0 comments on commit 02b9720

Please sign in to comment.