-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Plugins management #1425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugins management #1425
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,11 @@ shopt -s nullglob | |
| export DOKKU_DISTRO=${DOKKU_DISTRO:="ubuntu"} | ||
| export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish"} | ||
| export DOKKU_ROOT=${DOKKU_ROOT:=~dokku} | ||
| export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"} | ||
|
|
||
| export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"} | ||
| export PLUGIN_PATH=${PLUGIN_PATH:="$DOKKU_LIB_ROOT/plugins"} | ||
| export PLUGIN_CORE_PATH=${PLUGIN_CORE_PATH:="$DOKKU_LIB_ROOT/core-plugins"} | ||
| export PLUGIN_DISABLED_PATH=${PLUGIN_DISABLED_PATH:="$DOKKU_LIB_ROOT/disabled-plugins"} | ||
| export DOKKU_NOT_IMPLEMENTED_EXIT=10 | ||
| export DOKKU_VALID_EXIT=0 | ||
|
|
||
|
|
@@ -196,21 +199,46 @@ case "$1" in | |
| ;; | ||
|
|
||
| plugins) | ||
| ls -1 -d $PLUGIN_PATH/*/ | ||
| for plugin in "$PLUGIN_PATH"/*/; do | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here I did this since I think outputting only the name of the plugins is more useful than the complete path. I might be wrong 😅
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This probably will need to change with plugn, right @michaelshobbs ? |
||
| basename "$plugin" | ||
| done | ||
| ;; | ||
|
|
||
| plugins-install) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| if [[ $2 == "--core" ]]; then | ||
| export PLUGIN_PATH="$PLUGIN_CORE_PATH" | ||
| fi | ||
| pluginhook install | ||
| ;; | ||
|
|
||
| plugins-install-dependencies) | ||
| if [[ $2 == "--core" ]]; then | ||
| export PLUGIN_PATH="$PLUGIN_CORE_PATH" | ||
| fi | ||
| pluginhook dependencies | ||
| ;; | ||
|
|
||
| plugins-update) | ||
| pluginhook update | ||
| ;; | ||
|
|
||
| plugins:disable) | ||
| PLUGIN="$2" | ||
| [[ -e $PLUGIN_CORE_PATH/$PLUGIN ]] && echo "Cannot disable a core plugin" && exit 1 | ||
| [[ -e $PLUGIN_DISABLED_PATH/$PLUGIN ]] && echo "Plugin already disabled" && exit 1 | ||
| [[ ! -e $PLUGIN_PATH/$PLUGIN ]] && echo "Plugin does not exist" && exit 1 | ||
| mv "$PLUGIN_PATH/$PLUGIN" "$PLUGIN_DISABLED_PATH" | ||
| echo "Plugin $PLUGIN disabled" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pretty sure this should all be done via plugn, right?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah but if we're going to have two enabled places then we'll need to manage the plugin path ourselves somehow.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are still some unknowns for me about how this plays along with plugn. Another reason I'd like to pull it into the plugn branch and play around with it. Anyone opposed to this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nope |
||
| ;; | ||
|
|
||
| plugins:enable) | ||
| PLUGIN="$2" | ||
| [[ -e $PLUGIN_PATH/$PLUGIN ]] && echo "Plugin already enabled" && exit 1 | ||
| [[ ! -e $PLUGIN_DISABLED_PATH/$PLUGIN ]] && echo "Plugin does not exist" && exit 1 | ||
| mv "$PLUGIN_DISABLED_PATH/$PLUGIN" "$PLUGIN_PATH" | ||
| echo "Plugin $PLUGIN enabled" | ||
| ;; | ||
|
|
||
| # DEPRECATED as of v0.3.14 | ||
| deploy:all) | ||
| echo "*DEPRECATED* in v0.3.14: deploy:all will be removed in future versions" | ||
|
|
@@ -225,8 +253,11 @@ case "$1" in | |
| cat<<EOF | pluginhook commands help | sort | column -c2 -t -s, | ||
| help, Print the list of commands | ||
| plugins, Print active plugins | ||
| plugins-install, Install active plugins | ||
| plugins-install [--core], Install active plugins (or only core ones) | ||
| plugins-install-dependencies [--core], Install active plugins dependencies (or only core ones) | ||
| plugins-update, Update active plugins | ||
| plugins:enable <name>, Enable a previously disabled plugin | ||
| plugins:disable <name>, Disable an installed plugin (third-party only) | ||
| EOF | ||
| ;; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is never changed in the debian packaging, so we can't merge this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How so? Why couldn’t you update the Makefile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the debian packaging doesn't use a makefile...