From 2a4cbc7bee151768d4322393376fad0a75a80fc9 Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Tue, 16 Jun 2015 10:02:38 -0700 Subject: [PATCH] [ci skip] update docs --- .../{plugin-creation.md => plugn-creation.md} | 17 ++++++-- .../{pluginhooks.md => plugn-triggers.md} | 40 +++++++++---------- docs/plugins.md | 5 ++- docs/template.html | 4 +- 4 files changed, 38 insertions(+), 28 deletions(-) rename docs/development/{plugin-creation.md => plugn-creation.md} (92%) rename docs/development/{pluginhooks.md => plugn-triggers.md} (85%) diff --git a/docs/development/plugin-creation.md b/docs/development/plugn-creation.md similarity index 92% rename from docs/development/plugin-creation.md rename to docs/development/plugn-creation.md index 13ee06120..d7b58d844 100644 --- a/docs/development/plugin-creation.md +++ b/docs/development/plugn-creation.md @@ -1,14 +1,14 @@ -# Plugin Creation +# Plugn Creation If you create your own plugin: 1. Take a look at the plugins shipped with dokku and hack away! -2. Check out the [list of hooks](http://progrium.viewdocs.io/dokku/development/pluginhooks) your plugin can implement. +2. Check out the [list of hooks](http://progrium.viewdocs.io/dokku/development/plugn-triggers) your plugin can implement. 3. Upload your plugin to github with a repository name in form of `dokku-` (e.g. `dokku-mariadb`) 4. Edit [this page](http://progrium.viewdocs.io/dokku/plugins) and add a link to it. 5. Subscribe to the [dokku development blog](http://progrium.com) to be notified about API changes and releases -### Sample plugin +### Sample plugn The below plugin is a dummy `dokku hello` plugin. If your plugin exposes commands, this is a good template for your `commands` file: @@ -31,7 +31,7 @@ case "$1" in ;; help) - cat && cat<, Says "Hello " hello:world, Says "Hello world" EOF @@ -44,6 +44,15 @@ EOF esac ``` +Each plugn requires a `plugin.toml` descriptor file with the following required fields: + +```shell +[plugin] +description = "dokku hello plugin" +version = "0.1.0" +[plugin.config] +``` + A few notes: - You should always support `DOKKU_TRACE` as specified on the 2nd line of the plugin. diff --git a/docs/development/pluginhooks.md b/docs/development/plugn-triggers.md similarity index 85% rename from docs/development/pluginhooks.md rename to docs/development/plugn-triggers.md index 63287f670..f727bd059 100644 --- a/docs/development/pluginhooks.md +++ b/docs/development/plugn-triggers.md @@ -1,15 +1,15 @@ -# Pluginhooks +# Plugn triggers -[Pluginhooks](https://github.com/progrium/pluginhook) are a good way to jack into existing dokku infrastructure. You can use them to modify the output of various dokku commands or override internal configuration. +[Plugn triggers](https://github.com/progrium/plugn) are a good way to jack into existing dokku infrastructure. You can use them to modify the output of various dokku commands or override internal configuration. -Pluginhooks are simply scripts that are executed by the system. You can use any language you want, so long as the script: +Plugn triggers are simply scripts that are executed by the system. You can use any language you want, so long as the script: - Is executable - Has the proper language requirements installed -For instance, if you wanted to write a pluginhook in PHP, you would need to have `php` installed and available on the CLI prior to pluginhook invocation. +For instance, if you wanted to write a plugn trigger in PHP, you would need to have `php` installed and available on the CLI prior to plugn trigger invocation. -The following is an example for the `nginx-hostname` pluginhook. It reverses the hostname that is provided to nginx during deploys. If you created an executable file named `nginx-hostname` with the following code in your plugin, it would be invoked by dokku during the normal app deployment process: +The following is an example for the `nginx-hostname` plugn trigger. It reverses the hostname that is provided to nginx during deploys. If you created an executable file named `nginx-hostname` with the following code in your plugn trigger, it would be invoked by dokku during the normal app deployment process: ```shell #!/usr/bin/env bash @@ -21,17 +21,17 @@ NEW_SUBDOMAIN=`echo $SUBDOMAIN | rev` echo "$NEW_SUBDOMAIN.$VHOST" ``` -## Available Pluginhooks +## Available Plugn triggers -There are a number of plugin-related pluginhooks. These can be optionally implemented by plugins and allow integration into the standard dokku plugin setup/backup/teardown process. +There are a number of plugin-related triggers. These can be optionally implemented by plugins and allow integration into the standard dokku setup/backup/teardown process. -The following pluginhooks describe those available to a dokku installation. As well, there is an example for each pluginhook that you can use as templates for your own plugin development. +The following plugn triggers describe those available to a dokku installation. As well, there is an example for each trigger that you can use as templates for your own plugn development. -> The example pluginhook code is not guaranteed to be implemented as in within dokkku, and are merely simplified examples. Please look at the dokku source for larger, more in-depth examples. +> The example plugn trigger code is not guaranteed to be implemented as in within dokkku, and are merely simplified examples. Please look at the dokku source for larger, more in-depth examples. ### `install` -- Description: Used to setup any files/configuration for a plugin. +- Description: Used to setup any files/configuration for a plugn. - Invoked by: `dokku plugins-install`. - Arguments: None - Example: @@ -57,7 +57,7 @@ fi ```shell #!/usr/bin/env bash -# Installs nginx for the current plugin +# Installs nginx for the current plugn # Supports both opensuse and ubuntu set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x @@ -76,7 +76,7 @@ esac ### `update` -- Description: Can be used to run plugin updates on a regular interval. You can schedule the invoker in a cron-task to ensure your system gets regular updates. +- 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`. - Arguments: None - Example: @@ -93,20 +93,20 @@ sudo BUILD_STACK=true make install ### `commands help` -- Description: Used to aggregate all plugin `help` output. Your plugin should implement a `help` command in your `commands` file to take advantage of this pluginhook. This must be implemented inside the `commands` pluginhook file. +- Description: Used to aggregate all plugn `help` output. Your plugn should implement a `help` command in your `commands` file to take advantage of this plugn trigger. This must be implemented inside the `commands` plugn file. - Invoked by: `dokku help` - Arguments: None - Example: ```shell #!/usr/bin/env bash -# Outputs help for the derp plugin +# Outputs help for the derp plugn set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x case "$1" in help | derp:help) - cat && cat< dokku plugins-install ``` diff --git a/docs/template.html b/docs/template.html index fa646570e..0346c1e63 100644 --- a/docs/template.html +++ b/docs/template.html @@ -76,8 +76,8 @@ Development - Plugin Creation - Pluginhooks + Plugn Creation + Plugn Triggers Test Suite Release Process