feat: add a subcommand for retrieving failed app deploy logs

This can be useful in cases where a developer wishes to see what error messages are available for a failed deploy, but does not wish to spelunk around `docker ps -a` output.

Note that the logs are not made available once a further deploy is triggered, or after the containers have been garbage collected.
This commit is contained in:
Jose Diaz-Gonzalez committed 2018-07-29 17:17:53 -04:00
1 parent 8b932971df
commit 78f467852e
11 files changed
+172 -44

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
cmd-logs-failed() {
declare desc="shows the last failed deploy logs for an app"
declare cmd="logs:failed" argv=("$@"); [[ ${argv[0]} == "$cmd" ]] && shift 1
declare APP="$1"
local DOKKU_SCHEDULER
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
DOKKU_SCHEDULER=$(config_get "$APP" DOKKU_SCHEDULER || echo "docker-local")
plugn trigger scheduler-failed "$DOKKU_SCHEDULER" "$APP"
}
cmd-logs-failed "$@"