mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Merge pull request #1003 from progrium/mh-fix-cleanup
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)
|
||||
# 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
|
||||
docker rmi "$(docker images -f 'dangling=true' -q)" &> /dev/null &
|
||||
# shellcheck disable=SC2046
|
||||
docker rmi $(docker images -f 'dangling=true' -q) &> /dev/null &
|
||||
;;
|
||||
|
||||
plugins)
|
||||
|
||||
@@ -11,12 +11,12 @@ teardown() {
|
||||
}
|
||||
|
||||
@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 "status: "$status
|
||||
container="$output"
|
||||
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 "status: "$status
|
||||
assert_success
|
||||
@@ -24,7 +24,8 @@ teardown() {
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
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 "status: "$status
|
||||
assert_failure
|
||||
|
||||
Reference in New Issue
Block a user