From 39912ce5dbe0d86f37e1c46b3111ce9b1cd4bbaa Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 12 Dec 2014 01:07:08 -0500 Subject: [PATCH 1/4] Allow sourcing in any file in .dokkurc This allows us to configure dokku env-vars individually. Such a feature is useful if a developer would like to enable or disable DOKKU_TRACE without parsing a dokkurc file. --- dokku | 1 + 1 file changed, 1 insertion(+) 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 From b9b9d6303a5e329e8c22262add34792581d1473a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 12 Dec 2014 01:07:43 -0500 Subject: [PATCH 2/4] Add a `dokku trace` command to allow easy toggling of the DOKKU_TRACE option --- plugins/00_dokku-standard/commands | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 ;; From 784e2cfd5e95fe845777b441bdc8843d3e7bf26b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 12 Dec 2014 01:09:59 -0500 Subject: [PATCH 3/4] Add a note about enabling `dokku trace` via the cli --- docs/troubleshooting.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 02593c555..cceb5fee3 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -43,7 +43,12 @@ __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 From dec8056ef51d89e3bcc39becf792e19b82678410 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 12 Dec 2014 01:10:10 -0500 Subject: [PATCH 4/4] Link to gist.github.com --- docs/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index cceb5fee3..a806089a4 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -52,7 +52,7 @@ In versions older than 0.3.9, you can create a `/home/dokku/dokkurc` file contai 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. ***