From e61475c7eae98d5dd7582327290a3c15e639cdfd Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Sat, 14 Jan 2017 14:26:35 -0800 Subject: [PATCH] add plugin docs regarding compiled languages and command API --- docs/development/plugin-creation.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/development/plugin-creation.md b/docs/development/plugin-creation.md index b8d5e1b8d..9fa00c449 100644 --- a/docs/development/plugin-creation.md +++ b/docs/development/plugin-creation.md @@ -1,5 +1,7 @@ # Plugin Creation +Plugins can simply be implementations of [triggers](/dokku/development/plugin-triggers) or they may implement a command structure of their own. Dokku has no restrictions on the language in which a plugin is implemented, it only cares that the plugin implements the appropriate [commands](/dokku/development/plugin-creation#command-api) or [triggers](/dokku/development/plugin-triggers) API. NOTE: all files that implement the triggers or commands API must be executable. + If you create your own plugin: 1. Take a look at the plugins shipped with Dokku and hack away! @@ -9,6 +11,23 @@ If you create your own plugin: 5. Subscribe to the [dokku development blog](http://progrium.com) to be notified about API changes and releases +### Compilable Plugins (i.e. golang, java(?), c, etc.) +The plugin developer is required to implement the `install` trigger such that it will output your built executable(s) in the correct directory structure to implement the plugin's desired command and/or trigger API. See [smoke-test-plugin](https://github.com/dokku/smoke-test-plugin) for an example. + + +### Command API +There are 3 main implementation points: `commands`, `subcommands/default`, and `subcommands/` + +#### commands +Primarily used to supply the plugin's usage/help output. (i.e. [plugin help](https://github.com/dokku/dokku/tree/master/plugins/plugin/commands)) + +#### subcommands/default +Implements the plugin's default command behavior. (i.e. [`dokku plugin`](https://github.com/dokku/dokku/tree/master/plugins/plugin/subcommands/default)) + +#### subcommands/ +Implements the additional command interface and will translate to `dokku plugin:cmd` on the command line. (i.e. (i.e. [`dokku plugin:install`](https://github.com/dokku/dokku/tree/master/plugins/plugin/subcommands/install)) + + ### Sample plugin The below plugin is a dummy `dokku hello` plugin.