Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
123 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
[[ " help trace:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT" | ||
source "$PLUGIN_AVAILABLE_PATH/trace/internal-functions" | ||
set -eo pipefail | ||
[[ $DOKKU_TRACE ]] && set -x | ||
|
||
case "$1" in | ||
help | trace:help) | ||
trace_help_cmd "$@" | ||
;; | ||
|
||
*) | ||
exit "$DOKKU_NOT_IMPLEMENTED_EXIT" | ||
;; | ||
|
||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" | ||
|
||
trace_help_content_func() { | ||
declare desc="return trace plugin help content" | ||
cat <<help_content | ||
trace, [DEPRECATED] Enables/Disables trace mode | ||
trace:on, Clones an app | ||
trace:off, Create a new app | ||
help_content | ||
} | ||
|
||
trace_help_cmd() { | ||
if [[ $1 == "trace:help" ]]; then | ||
echo -e 'Usage: dokku trace[:COMMAND]' | ||
echo '' | ||
echo 'Manage trace mode' | ||
echo '' | ||
echo 'Additional commands:' | ||
trace_help_content_func | sort | column -c2 -t -s, | ||
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then | ||
trace_help_content_func | ||
else | ||
cat <<help_desc | ||
trace, Manage trace mode | ||
help_desc | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[plugin] | ||
description = "dokku core trace plugin" | ||
version = "0.16.4" | ||
[plugin.config] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
[[ $DOKKU_TRACE ]] && set -x | ||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" | ||
|
||
trace_off_cmd() { | ||
declare desc="disables trace mode" | ||
local cmd="trace" | ||
[[ -d $DOKKU_ROOT/.dokkurc ]] || mkdir -p "$DOKKU_ROOT/.dokkurc" | ||
|
||
dokku_log_info1 "Disabling trace mode" | ||
rm -f "$DOKKU_ROOT/.dokkurc/DOKKU_TRACE" | ||
} | ||
|
||
trace_off_cmd "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
[[ $DOKKU_TRACE ]] && set -x | ||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" | ||
|
||
trace_on_cmd() { | ||
declare desc="enables trace mode" | ||
local cmd="trace" | ||
[[ -d $DOKKU_ROOT/.dokkurc ]] || mkdir -p "$DOKKU_ROOT/.dokkurc" | ||
|
||
dokku_log_info1 "Enabling trace mode" | ||
echo "export DOKKU_TRACE=1" >"$DOKKU_ROOT/.dokkurc/DOKKU_TRACE" | ||
} | ||
|
||
trace_on_cmd "$@" |