diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 02593c555..a806089a4 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -43,11 +43,16 @@ __Solution:__ The `remote rejected` error does not give enough information. Anything could have failed. -Create a `/home/dokku/dokkurc` file containing the following : +To enable dokku tracing, simply run the following command: + + # Since 0.3.9 + dokku trace + +In versions older than 0.3.9, you can create a `/home/dokku/dokkurc` file containing the following : export DOKKU_TRACE=1 -This will trace all of dokku's activity. If this does not help you create a pastebin or a gist containing the full log, and create an issue. +This will trace all of dokku's activity. If this does not help you, create a [gist](https://gist.github.com) containing the full log, and create an issue. *** diff --git a/dokku b/dokku index 0246d8965..c6a1cb769 100755 --- a/dokku +++ b/dokku @@ -10,6 +10,7 @@ export DOKKU_NOT_IMPLEMENTED_EXIT=10 export DOKKU_VALID_EXIT=0 [[ -f $DOKKU_ROOT/dokkurc ]] && source $DOKKU_ROOT/dokkurc +[[ -d $DOKKU_ROOT/.dokkurc ]] && for f in $DOKKU_ROOT/.dokkurc/*; do source $f; done [[ $DOKKU_TRACE ]] && set -x diff --git a/plugins/00_dokku-standard/commands b/plugins/00_dokku-standard/commands index 7fd4f9476..eb32e8037 100755 --- a/plugins/00_dokku-standard/commands +++ b/plugins/00_dokku-standard/commands @@ -2,6 +2,24 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x case "$1" in + trace) + [[ -d $DOKKU_ROOT/.dokkurc ]] || mkdir -p $DOKKU_ROOT/.dokkurc + [[ "$2" == "on" ]] || [[ "$2" == "off" ]] || { + echo "Valid trace options are [on/off]" + exit 1 + } + + if [[ "$2" == "on" ]]; then + echo "Enabling dokku trace" + echo "export DOKKU_TRACE=1" > $DOKKU_ROOT/.dokkurc/DOKKU_TRACE + fi + + if [[ "$2" == "off" ]]; then + echo "Disabling dokku trace" + rm -f $DOKKU_ROOT/.dokkurc/DOKKU_TRACE + fi + ;; + delete) dokku apps:destroy $2 ;;