Merge pull request #2650 from dokku/2627-bare-help-output

Fix help output for nginx and ssh-keys
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2017-03-13 10:36:25 -06:00
commit 621b31839e
23 files changed
+105 -60

No files matched your search

+1 -1
View File
@@ -3,11 +3,11 @@
> New as of 0.4.0 > New as of 0.4.0
``` ```
plugin # Print active plugins
plugin:disable <name> # Disable an installed plugin (third-party only) plugin:disable <name> # Disable an installed plugin (third-party only)
plugin:enable <name> # Enable a previously disabled plugin plugin:enable <name> # Enable a previously disabled plugin
plugin:install [--core|git-url [--committish tag|branch|commit|--name custom-plugin-name]] # Optionally download git-url (with custom tag/committish) & run install trigger for active plugins (or only core ones) plugin:install [--core|git-url [--committish tag|branch|commit|--name custom-plugin-name]] # Optionally download git-url (with custom tag/committish) & run install trigger for active plugins (or only core ones)
plugin:install-dependencies [--core] # Run install-dependencies trigger for active plugins (or only core ones) plugin:install-dependencies [--core] # Run install-dependencies trigger for active plugins (or only core ones)
plugin:list # Print active plugins
plugin:uninstall <name> # Uninstall a plugin (third-party only) plugin:uninstall <name> # Uninstall a plugin (third-party only)
plugin:update [name [committish]] # Optionally update named plugin from git (with custom tag/committish) & run update trigger for active plugins plugin:update [name [committish]] # Optionally update named plugin from git (with custom tag/committish) & run update trigger for active plugins
``` ```
+2 -2
View File
@@ -30,7 +30,7 @@ hello_main_cmd() {
set -- $cmd $@ set -- $cmd $@
## ##
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1 [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$2" verify_app_name "$2"
local APP="$2"; local APP="$2";
@@ -58,7 +58,7 @@ hello_world_cmd() {
set -- $cmd $@ set -- $cmd $@
## ##
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1 [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$2" verify_app_name "$2"
local APP="$2"; local APP="$2";
+1 -1
View File
@@ -56,7 +56,7 @@ if [[ $(id -un) != "dokku" ]] && [[ ! $1 =~ plugin:* ]] && [[ ! $1 == "ssh-keys:
exit $? exit $?
fi fi
if [[ $(id -un) != "root" && $1 =~ ^plugin:.* ]] || [[ $(id -un) != "root" && $1 == "ssh-keys:add" ]]; then if [[ $(id -un) != "root" && $1 =~ ^plugin:.* && $1 != "plugin:help" && $1 != "plugin:list" ]] || [[ $(id -un) != "root" && $1 == "ssh-keys:add" ]]; then
dokku_log_fail "This command must be run as root" dokku_log_fail "This command must be run as root"
fi fi
+1 -1
View File
@@ -530,7 +530,7 @@ dokku_deploy_cmd() {
source "$PLUGIN_AVAILABLE_PATH/config/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions"
source "$PLUGIN_AVAILABLE_PATH/proxy/functions" source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
[[ -z $1 ]] && dokku_log_fail "Please specify an app to deploy" [[ -z $1 ]] && dokku_log_fail "Please specify an app to run the command on"
local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG") local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
verify_app_name "$APP" verify_app_name "$APP"
plugn trigger pre-deploy "$APP" "$IMAGE_TAG" plugn trigger pre-deploy "$APP" "$IMAGE_TAG"
+1 -1
View File
@@ -7,7 +7,7 @@ source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
nginx_logs_cmd() { nginx_logs_cmd() {
declare desc="display app nginx logs from command line" declare desc="display app nginx logs from command line"
local cmd="$1" local cmd="$1"
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1 [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
nginx_logs "$@" nginx_logs "$@"
} }
@@ -7,7 +7,7 @@ source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
nginx_build_config_cmd() { nginx_build_config_cmd() {
declare desc="build nginx config to proxy app containers from command line" declare desc="build nginx config to proxy app containers from command line"
local cmd="nginx:build-config" local cmd="nginx:build-config"
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1 [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
nginx_build_config "$2" nginx_build_config "$2"
} }
+1 -1
View File
@@ -2,4 +2,4 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/internal-functions" source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/internal-functions"
nginx_vhosts_help_cmd "$@" nginx_vhosts_help_cmd "nginx:help"
+1 -1
View File
@@ -7,7 +7,7 @@ case "$1" in
help_content_func () { help_content_func () {
declare desc="return plugin plugin help content" declare desc="return plugin plugin help content"
cat<<help_content cat<<help_content
plugin, Print active plugins plugin:list, Print active plugins
plugin:install [--core|git-url [--committish tag|branch|commit|--name custom-plugin-name]], Optionally download git-url (with custom tag/committish) & run install trigger for active plugins (or only core ones) plugin:install [--core|git-url [--committish tag|branch|commit|--name custom-plugin-name]], Optionally download git-url (with custom tag/committish) & run install trigger for active plugins (or only core ones)
plugin:install-dependencies [--core], Run install-dependencies trigger for active plugins (or only core ones) plugin:install-dependencies [--core], Run install-dependencies trigger for active plugins (or only core ones)
plugin:update [name [committish]], Optionally update named plugin from git (with custom tag/committish) & run update trigger for active plugins plugin:update [name [committish]], Optionally update named plugin from git (with custom tag/committish) & run update trigger for active plugins
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
plugin_list_cmd() {
declare desc="lists all plugins"
local cmd="plugin"
plugn version
plugn list
}
+4 -8
View File
@@ -1,11 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/plugin/internal-functions"
plugin_main_cmd() { dokku_log_warn "Deprecated: Please use plugin:list"
declare desc="shows details about locally installed plugins" plugin_list_cmd "$@"
local cmd="plugin"
plugn version
plugn list
}
plugin_main_cmd "$@"
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/plugin/internal-functions"
plugin_list_cmd "$@"
+2
View File
@@ -5,6 +5,8 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
ps_main_cmd() { ps_main_cmd() {
declare desc="shows running processes in all running app containers" declare desc="shows running processes in all running app containers"
local cmd="ps" local cmd="ps"
dokku_log_warn "Deprecated: Please use ps:report"
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
local APP="$2"; verify_app_name "$APP" local APP="$2"; verify_app_name "$APP"
+2 -18
View File
@@ -1,27 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
[[ " help repo:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT" [[ " help repo:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
source "$PLUGIN_AVAILABLE_PATH/repo/internal-functions"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$1" in case "$1" in
help | repo:help) help | repo:help)
help_content_func () { repo_help_cmd "$@"
declare desc="return repo plugin help content"
cat<<help_content
repo:gc <app>, Runs 'git gc --aggressive' against the application's repo
repo:purge-cache <app>, Deletes the contents of the build cache stored in the repository
help_content
}
if [[ $1 = "repo:help" ]] ; then
echo -e 'Usage: dokku repo[:COMMAND]'
echo ''
echo "Runs commands that interact with the app's repo"
echo ''
echo 'Additional commands:'
help_content_func | sort | column -c2 -t -s,
else
help_content_func
fi
;; ;;
*) *)
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
repo_help_content_func () {
declare desc="return repo plugin help content"
cat<<help_content
repo:gc <app>, Runs 'git gc --aggressive' against the application's repo
repo:purge-cache <app>, Deletes the contents of the build cache stored in the repository
help_content
}
repo_help_cmd() {
if [[ $1 = "repo:help" ]] ; then
echo -e 'Usage: dokku repo[:COMMAND]'
echo ''
echo "Runs commands that interact with the app's repo"
echo ''
echo 'Additional commands:'
repo_help_content_func | sort | column -c2 -t -s,
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
repo_help_content_func
else
cat<<help_desc
repo, Runs commands that interact with the app's repo
help_desc
fi
}
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/repo/internal-functions"
repo_help_cmd "repo:help"
+2 -2
View File
@@ -2,8 +2,8 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
ssh_keys_help_content_func() { ssh_keys_help_content_func() {
declare desc="return ssh-keys plugin help content" declare desc="return ssh-keys plugin help content"
cat<<help_content cat<<help_content
ssh-keys:list, List of all authorized dokku public ssh keys ssh-keys:list, List of all authorized dokku public ssh keys
ssh-keys:add <name> [/path/to/key], Add a new public key by pipe or path ssh-keys:add <name> [/path/to/key], Add a new public key by pipe or path
ssh-keys:remove <name>, Remove SSH public key by name ssh-keys:remove <name>, Remove SSH public key by name
+1 -1
View File
@@ -2,4 +2,4 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/ssh-keys/internal-functions" source "$PLUGIN_AVAILABLE_PATH/ssh-keys/internal-functions"
ssh_keys_help_cmd "$@" ssh_keys_help_cmd "ssh-keys:help"
+2 -1
View File
@@ -1,12 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/docker-options/functions"
storage_list_cmd() { storage_list_cmd() {
declare desc="List all bound mounts" declare desc="List all bound mounts"
local cmd="storage:list" local cmd="storage:list"
local passed_phases="deploy" local passed_phases="deploy"
[[ ! $2 ]] && dokku_log_fail "storage:list requires an app to list." [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
verify_app_name "$2" && local APP="$2" verify_app_name "$2" && local APP="$2"
echo "$APP volume bind-mounts:" echo "$APP volume bind-mounts:"
get_bind_mounts "$(get_phase_file_path "$passed_phases")" get_bind_mounts "$(get_phase_file_path "$passed_phases")"
+2 -1
View File
@@ -2,11 +2,12 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/storage/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/storage/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/docker-options/functions"
storage_main_cmd() { storage_main_cmd() {
declare desc="an alias for storage:list" declare desc="an alias for storage:list"
local cmd="storage" local cmd="storage"
dokku_log_warn "Deprecated: Please use storage:list"
storage_list_cmd "$@" storage_list_cmd "$@"
} }
-2
View File
@@ -1,8 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/storage/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/storage/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/docker-options/functions"
storage_list_cmd "$@" storage_list_cmd "$@"
+2 -18
View File
@@ -1,27 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
[[ " help tar:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT" [[ " help tar:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
source "$PLUGIN_AVAILABLE_PATH/tar/internal-functions"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$1" in case "$1" in
help | tar:help) help | tar:help)
help_content_func () { tar_help_cmd "$1"
declare desc="return tar plugin help content"
cat<<help_content
tar:in <app>, Reads an tarball containing the app from stdin
tar:from <app> <url>, Loads an app tarball from url
help_content
}
if [[ $1 = "tar:help" ]] ; then
echo -e 'Usage: dokku tar[:COMMAND]'
echo ''
echo 'An alternative to using git, apps are loaded via tarballs instead.'
echo ''
echo 'Additional commands:'
help_content_func | sort | column -c2 -t -s,
else
help_content_func
fi
;; ;;
*) *)
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
tar_help_content_func() {
declare desc="return tar plugin help content"
cat<<help_content
tar:in <app>, Reads an tarball containing the app from stdin
tar:from <app> <url>, Loads an app tarball from url
help_content
}
tar_help_cmd() {
if [[ $1 = "tar:help" ]] ; then
echo -e 'Usage: dokku tar[:COMMAND]'
echo ''
echo 'An alternative to using git, apps are loaded via tarballs instead.'
echo ''
echo 'Additional commands:'
tar_help_content_func | sort | column -c2 -t -s,
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
tar_help_content_func
else
cat<<help_desc
tar, Deploy applications via tarball instead of git
help_desc
fi
}
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/tar/internal-functions"
tar_help_cmd "tar:help"