remove quoting around cleanup and disable lint for those lines. also make cleanup test more robust
This commit is contained in:
6
dokku
6
dokku
@@ -122,9 +122,11 @@ case "$1" in
|
|||||||
|
|
||||||
cleanup)
|
cleanup)
|
||||||
# delete all non-running container
|
# delete all non-running container
|
||||||
docker rm "$(docker ps -a -f 'status=exited' -q)" &> /dev/null &
|
# shellcheck disable=SC2046
|
||||||
|
docker rm $(docker ps -a -f 'status=exited' -q) &> /dev/null &
|
||||||
# delete unused images
|
# delete unused images
|
||||||
docker rmi "$(docker images -f 'dangling=true' -q)" &> /dev/null &
|
# shellcheck disable=SC2046
|
||||||
|
docker rmi $(docker images -f 'dangling=true' -q) &> /dev/null &
|
||||||
;;
|
;;
|
||||||
|
|
||||||
plugins)
|
plugins)
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ teardown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "remove exited containers" {
|
@test "remove exited containers" {
|
||||||
run dokku run $TEST_APP hostname
|
# make sure we have many exited containers of the same 'type'
|
||||||
|
run bash -c "for cnt in 1 2 3; do dokku run $TEST_APP hostname; done"
|
||||||
echo "output: "$output
|
echo "output: "$output
|
||||||
echo "status: "$status
|
echo "status: "$status
|
||||||
container="$output"
|
|
||||||
assert_success
|
assert_success
|
||||||
run bash -c "docker ps -a -f 'status=exited' -q --no-trunc=false | grep -q $container"
|
run bash -c "docker ps -a -f 'status=exited' --no-trunc=false | grep '/exec hostname'"
|
||||||
echo "output: "$output
|
echo "output: "$output
|
||||||
echo "status: "$status
|
echo "status: "$status
|
||||||
assert_success
|
assert_success
|
||||||
@@ -24,7 +24,8 @@ teardown() {
|
|||||||
echo "output: "$output
|
echo "output: "$output
|
||||||
echo "status: "$status
|
echo "status: "$status
|
||||||
assert_success
|
assert_success
|
||||||
run bash -c "docker ps -a -f 'status=exited' -q --no-trunc=false | grep -q $container"
|
sleep 5 # wait for dokku cleanup to happen in the background
|
||||||
|
run bash -c "docker ps -a -f 'status=exited' --no-trunc=false | grep '/exec hostname'"
|
||||||
echo "output: "$output
|
echo "output: "$output
|
||||||
echo "status: "$status
|
echo "status: "$status
|
||||||
assert_failure
|
assert_failure
|
||||||
|
|||||||
Reference in New Issue
Block a user