File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -34,14 +34,24 @@ wait_for_ready() {
3434
3535wait_for_removed () {
3636 for i in {1..30}; do
37- if ! docker ps -q --filter " name=http-echo-tests" | grep -q . ; then
37+ if ! docker ps -aq --filter " name=http-echo-tests" | grep -q . ; then
3838 return 0
3939 fi
4040 sleep 0.5
4141 done
4242 echo " Container failed to stop" ; exit 1
4343}
4444
45+ cleanup () {
46+ echo " Cleaning up..."
47+ docker stop http-echo-tests 2> /dev/null || true
48+ docker rm http-echo-tests 2> /dev/null || true
49+ popd 2> /dev/null || true
50+ rm -rf testarea
51+ }
52+
53+ trap cleanup EXIT
54+
4555if ! [ -x " $( command -v jq) " ]; then
4656 message " JQ not installed. Installing..."
4757 sudo apt -y install jq
@@ -747,6 +757,4 @@ message " Stop containers "
747757docker stop http-echo-tests
748758wait_for_removed
749759
750- popd
751- rm -rf testarea
752760message " DONE"
You can’t perform that action at this time.
0 commit comments