mirror of
https://github.com/dokku/dokku.git
synced 2026-02-23 19:50:34 +01:00
move plugin-* to plugin: namespace
This commit is contained in:
committed by
Jose Diaz-Gonzalez
parent
e873f27eac
commit
18d234a925
4
Makefile
4
Makefile
@@ -70,10 +70,10 @@ version:
|
||||
git describe --tags > ~dokku/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION
|
||||
|
||||
plugin-dependencies: plugn
|
||||
dokku plugins-install-dependencies --core
|
||||
dokku plugin:install-dependencies --core
|
||||
|
||||
plugins: plugn docker
|
||||
dokku plugins-install --core
|
||||
dokku plugin:install --core
|
||||
|
||||
dependencies: apt-update sshcommand plugn docker help2man man-db
|
||||
$(MAKE) -e stack
|
||||
|
||||
4
debian/postinst
vendored
4
debian/postinst
vendored
@@ -16,7 +16,7 @@ case "$1" in
|
||||
sshcommand create dokku /usr/local/bin/dokku
|
||||
egrep -i "^docker" /etc/group || groupadd docker
|
||||
usermod -aG docker dokku
|
||||
dokku plugins-install --core
|
||||
dokku plugin:install --core
|
||||
rm -f /home/dokku/VERSION
|
||||
cp /var/lib/dokku/STABLE_VERSION /home/dokku/VERSION
|
||||
|
||||
@@ -31,7 +31,7 @@ case "$1" in
|
||||
|
||||
db_get "dokku/vhost_enable"
|
||||
if [ "$RET" = "true" ]; then
|
||||
db_get "dokku/hostname"
|
||||
db_get "dokku/hostname"
|
||||
echo "$RET" > "${DOKKU_ROOT}/VHOST"
|
||||
else
|
||||
rm -f "${DOKKU_ROOT}/VHOST"
|
||||
|
||||
@@ -65,7 +65,7 @@ A few notes:
|
||||
```shell
|
||||
IMAGE=$(docker images | grep "user/repo" | awk '{print $3}')
|
||||
if [[ -z $IMAGE ]]; then
|
||||
dokku_log_fail "user/repo image not found... Did you run 'dokku plugins-install'?"
|
||||
dokku_log_fail "user/repo image not found... Did you run 'dokku plugin:install'?"
|
||||
fi
|
||||
```
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ The following plugn triggers describe those available to a dokku installation. A
|
||||
### `install`
|
||||
|
||||
- Description: Used to setup any files/configuration for a plugn.
|
||||
- Invoked by: `dokku plugins-install`.
|
||||
- Invoked by: `dokku plugin:install`.
|
||||
- Arguments: None
|
||||
- Example:
|
||||
|
||||
@@ -50,8 +50,8 @@ fi
|
||||
|
||||
### `dependencies`
|
||||
|
||||
- Description: Used to install system-level dependencies. Invoked by `plugins-install-dependencies`.
|
||||
- Invoked by: `dokku plugins-install-dependencies`
|
||||
- Description: Used to install system-level dependencies. Invoked by `plugin:install-dependencies`.
|
||||
- Invoked by: `dokku plugin:install-dependencies`
|
||||
- Arguments: None
|
||||
- Example:
|
||||
|
||||
@@ -77,7 +77,7 @@ esac
|
||||
### `update`
|
||||
|
||||
- Description: Can be used to run plugn updates on a regular interval. You can schedule the invoker in a cron-task to ensure your system gets regular updates.
|
||||
- Invoked by: `dokku plugins-update`.
|
||||
- Invoked by: `dokku plugin:update`.
|
||||
- Arguments: None
|
||||
- Example:
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Let's take a quick look at the current dokku nginx plugin that's shipped with do
|
||||
```shell
|
||||
cd /var/lib/dokku/plugins/available
|
||||
git clone <git url>
|
||||
dokku plugins-install
|
||||
dokku plugin:install
|
||||
```
|
||||
## Creating your own plugin
|
||||
|
||||
|
||||
47
dokku
47
dokku
@@ -36,7 +36,7 @@ if [[ "${args[0]}" =~ ^--.* ]]; then
|
||||
fi
|
||||
! has_tty && DOKKU_QUIET_OUTPUT=1
|
||||
|
||||
if [[ $(id -un) != "dokku" && $1 != plugins-install* && $1 != "plugins-update" ]]; then
|
||||
if [[ $(id -un) != "dokku" && $1 != plugin:install* && $1 != "plugin:update" ]]; then
|
||||
sudo -u dokku -E -H $0 "$@"
|
||||
exit
|
||||
fi
|
||||
@@ -200,45 +200,6 @@ case "$1" in
|
||||
docker_cleanup
|
||||
;;
|
||||
|
||||
plugins)
|
||||
plugn list
|
||||
;;
|
||||
|
||||
plugins-install)
|
||||
if [[ $2 == "--core" ]]; then
|
||||
export PLUGIN_PATH="$PLUGIN_CORE_PATH"
|
||||
fi
|
||||
plugn trigger install
|
||||
;;
|
||||
|
||||
plugins-install-dependencies)
|
||||
if [[ $2 == "--core" ]]; then
|
||||
export PLUGIN_PATH="$PLUGIN_CORE_PATH"
|
||||
fi
|
||||
plugn trigger dependencies
|
||||
;;
|
||||
|
||||
plugins-update)
|
||||
plugn trigger 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"
|
||||
;;
|
||||
|
||||
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"
|
||||
@@ -252,12 +213,6 @@ case "$1" in
|
||||
|
||||
cat<<EOF | plugn trigger commands help | sort | column -c2 -t -s,
|
||||
help, Print the list of commands
|
||||
plugins, Print 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
|
||||
;;
|
||||
|
||||
|
||||
62
plugins/plugin/commands
Executable file
62
plugins/plugin/commands
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_PATH/available/common/functions"
|
||||
|
||||
case "$1" in
|
||||
plugin)
|
||||
plugn list
|
||||
;;
|
||||
|
||||
plugin:install)
|
||||
if [[ $2 == "--core" ]]; then
|
||||
export PLUGIN_PATH="$PLUGIN_CORE_PATH"
|
||||
fi
|
||||
plugn trigger install
|
||||
;;
|
||||
|
||||
plugin:install-dependencies)
|
||||
if [[ $2 == "--core" ]]; then
|
||||
export PLUGIN_PATH="$PLUGIN_CORE_PATH"
|
||||
fi
|
||||
plugn trigger dependencies
|
||||
;;
|
||||
|
||||
plugin:update)
|
||||
plugn trigger 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"
|
||||
;;
|
||||
|
||||
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"
|
||||
;;
|
||||
|
||||
help | ps:help)
|
||||
cat<<EOF
|
||||
plugin, Print active plugins
|
||||
plugin:install [--core], Install active plugins (or only core ones)
|
||||
plugin:install-dependencies [--core], Install active plugins dependencies (or only core ones)
|
||||
plugin:update, Update active plugins
|
||||
plugin:enable <name>, Enable a previously disabled plugin
|
||||
plugin:disable <name>, Disable an installed plugin (third-party only)
|
||||
EOF
|
||||
;;
|
||||
|
||||
*)
|
||||
exit $DOKKU_NOT_IMPLEMENTED_EXIT
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
|
||||
4
plugins/plugin/plugin.toml
Normal file
4
plugins/plugin/plugin.toml
Normal file
@@ -0,0 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core plugin plugin"
|
||||
version = "0.4.0"
|
||||
[plugin.config]
|
||||
Reference in New Issue
Block a user