Merge pull request #3699 from robhudson/add-cleanup-help

Add `dokku cleanup` to help output
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2019-09-28 20:59:33 -04:00
commit b05a2b6da2
2 files changed
+10 -2

No files matched your search

+3 -2
View File
@@ -1,14 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
[[ " help help:help run:help trace:help url:help urls:help version:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT" [[ " help help:help cleanup:help run:help trace:help url:help urls:help version:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
set -eo pipefail set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x [[ $DOKKU_TRACE ]] && set -x
case "$1" in case "$1" in
help | run:help | trace:help | url:help | urls:help | version:help) help | cleanup:help | run:help | trace:help | url:help | urls:help | version:help)
[[ $(echo "$1" | sed '/.*:help/!d') ]] && help_topic="${1%\:help}" [[ $(echo "$1" | sed '/.*:help/!d') ]] && help_topic="${1%\:help}"
help_content_func() { help_content_func() {
declare desc="return standard plugin help content" declare desc="return standard plugin help content"
cat <<help_content cat <<help_content
cleanup [<app>], Cleans up exited/dead Docker containers and removes dangling images
run [--env KEY=VALUE] <app> <cmd>, Run a command in a new container using the current application image run [--env KEY=VALUE] <app> <cmd>, Run a command in a new container using the current application image
url <app>, Show the first URL for an application (compatibility) url <app>, Show the first URL for an application (compatibility)
urls <app>, Show all URLs for an application urls <app>, Show all URLs for an application
+7
View File
@@ -31,6 +31,13 @@ assert_url() {
assert_output "${url}" assert_output "${url}"
} }
@test "(core) cleanup:help" {
run /bin/bash -c "dokku cleanup:help"
echo "output: $output"
echo "status: $status"
assert_output_contains "Cleans up exited/dead Docker containers and removes dangling image"
}
@test "(core) run (with --options)" { @test "(core) run (with --options)" {
deploy_app deploy_app
run /bin/bash -c "dokku --force --quiet run $TEST_APP node --version" run /bin/bash -c "dokku --force --quiet run $TEST_APP node --version"