зеркало из https://github.com/Azure/draft-classic.git
Merge pull request #927 from christopherdiehl/patch-1
Update dep-005.md
This commit is contained in:
Коммит
95ffed4408
|
@ -50,7 +50,7 @@ $(draft home)/plugins/
|
|||
|
||||
In the example above, the `keybase` plugin is contained inside of a directory named `keybase`. It has two files: `plugin.yaml` (required) and an executable script, `keybase.sh` (optional).
|
||||
|
||||
The core of a plugin is a simple YAML file named `plugin.yaml`. Here is a plugin YAML for a plugin that adds support for Keybase operations:
|
||||
The core of a plugin is a simple YAML file named `plugin.yaml`. A sample YAML file for a plugin that adds support for Keybase operations is shown below:
|
||||
|
||||
```yaml
|
||||
name: "keybase"
|
||||
|
@ -63,7 +63,7 @@ useTunnel: false
|
|||
command: "$DRAFT_PLUGIN_DIR/keybase.sh"
|
||||
```
|
||||
|
||||
The `name` is the name of the plugin. When Draft executes it plugin, this is the name it will use (e.g. `draft NAME` will invoke this plugin).
|
||||
The `name` is the name used when Draft executes the plugin (e.g. `draft keybase` will invoke the keybase plugin).
|
||||
|
||||
_`name` should match the directory name._ In our example above, that means the plugin with `name: keybase` should be contained in a directory named `keybase`.
|
||||
|
||||
|
@ -78,7 +78,7 @@ Restrictions on `name`:
|
|||
|
||||
The `ignoreFlags` switch tells Draft to _not_ pass flags to the plugin. So if a plugin is called with `draft myplugin --foo` and `ignoreFlags: true`, then `--foo` is silently discarded.
|
||||
|
||||
The `useTunnel` switch indicates that the plugin needs a tunnel to Tiller. This should be set to `true` _anytime a plugin talks to tiller_. It will cause Draft to open a tunnel, and then set `$HELM_HOST` to the right local address for that tunnel.
|
||||
The `useTunnel` switch indicates that the plugin needs a tunnel to Tiller. If set to `true` Draft will open a tunnel and set `$HELM_HOST` to the tunnel's corresponding local address. This switch should be set to `true` _anytime a plugin talks to tiller_.
|
||||
|
||||
Finally, and most importantly, `command` is the command that this plugin will execute when it is called. Environment variables are interpolated before the plugin is executed. The pattern above illustrates the preferred way to indicate where the plugin program lives.
|
||||
|
||||
|
@ -88,7 +88,7 @@ There are some strategies for working with plugin commands:
|
|||
packaged in the plugin directory.
|
||||
- The `command:` line will have any environment variables expanded before
|
||||
execution. `$DRAFT_PLUGIN_DIR` will point to the plugin directory.
|
||||
- The command itself is not executed in a shell. So you can't oneline a shell script.
|
||||
- The command itself is not executed in a shell. So you can't condense a shell script to one line.
|
||||
- Draft injects lots of configuration into environment variables. Take a look at
|
||||
the environment to see what information is available.
|
||||
- Draft makes no assumptions about the language of the plugin. You can write it
|
||||
|
@ -142,7 +142,7 @@ Plugins _should_ display help text and then exit for `-h` and `--help`. In all o
|
|||
|
||||
# Reference Implementation
|
||||
|
||||
Exisiting plugins can be found on the [draft plugins](#draft-plugins) section of this page or by searching [Github](https://github.com/search?q=topic%3Adraft-plugin&type=Repositories)
|
||||
Exisiting plugins can be found on the [draft plugins](#building-plugins) section of this page or by searching [Github](https://github.com/search?q=topic%3Adraft-plugin&type=Repositories)
|
||||
|
||||
# Notes
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче