subcommand restructure and bashstyle refactor. closes #1579

This commit is contained in:
Michael S. Hobbs
2016-03-01 13:26:35 -08:00
committed by Michael Hobbs
parent 76e27f0333
commit 89f289b433
105 changed files with 1969 additions and 1306 deletions

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
plugin_main_cmd() {
local desc="shows details about locally installed plugins"
local cmd="plugin"
plugn version
plugn list
}
plugin_main_cmd "$@"

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
plugin_disable_cmd() {
local desc="disables plugin via command line"
local cmd="plugin:disable"
[[ -z $2 ]] && dokku_log_fail "Please specify a plugin to disable"
local PLUGIN="$2"
disable_plugin "$PLUGIN"
}
plugin_disable_cmd "$@"

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
plugin_enable_cmd() {
local desc="enables plugin via command line"
local cmd="plugin:enable"
[[ -z $2 ]] && dokku_log_fail "Please specify a plugin to enable"
local PLUGIN="$2"
enable_plugin "$PLUGIN"
}
plugin_enable_cmd "$@"

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
plugin_install_cmd() {
local desc="installs a plugin from URL and calls install plugin trigger via command line"
local cmd="plugin:install"
case "$2" in
--core)
[[ "$#" -gt 2 ]] && dokku_log_info1_quiet "Cannot install additional core plugins, running core plugin install trigger"
PLUGIN_PATH="$PLUGIN_CORE_PATH" plugn trigger install
;;
https:*|git*|ssh:*)
shift
download_and_enable_plugin "$@"
plugn trigger install
;;
*)
plugn trigger install
;;
esac
}
plugin_install_cmd "$@"

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
plugin_install_dependencies_cmd() {
local desc="calls dependencies plugin trigger via command line"
local cmd="plugin:install-dependencies"
if [[ $2 == "--core" ]]; then
export PLUGIN_PATH="$PLUGIN_CORE_PATH"
fi
plugn trigger dependencies
}
plugin_install_dependencies_cmd "$@"

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/plugin/functions"
plugin_uninstall_cmd() {
local desc="uninstalls plugin via command line"
local cmd="plugin:uninstall"
[[ -z $2 ]] && dokku_log_fail "Please specify a plugin to enable"
local PLUGIN="$2"
uninstall_plugin "$PLUGIN"
}
plugin_uninstall_cmd "$@"

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
plugin_update_cmd() {
local desc="updates plugin to optional committish and calls update plugin trigger via command line"
local cmd="plugin:update"
if [[ -n "$2" ]]; then
local PLUGIN="$2"
local PLUGIN_COMMITTISH="$3"
plugn update "$PLUGIN" "$PLUGIN_COMMITTISH"
fi
plugn trigger update
}
plugin_update_cmd "$@"