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

+3 -19
View File
@@ -1,27 +1,11 @@
#!/usr/bin/env bash
[[ " help logs:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
source "$PLUGIN_AVAILABLE_PATH/logs/internal-functions"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
usage() {
declare desc="logs specific usage"
echo "Usage: dokku logs <app>"
echo " display recent log output"
echo ""
echo " -n, --num NUM # the number of lines to display"
echo " -p, --ps PS # only display logs from the given process"
echo " -t, --tail # continually stream logs"
echo " -q, --quiet # display raw logs without colors, time and names"
}
case "$1" in
logs:help)
usage
;;
help)
cat<<EOF
logs <app> [-h] [-t] [-n num] [-q] [-p process], Show the last logs for an application
EOF
help | logs:help)
cmd-logs-help "$@"
;;
*)