mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-09 00:32:09 -04:00
docs: add installing plugins from a compiled binary example
This commit is contained in:
parent
8d9f0df7ad
commit
5ecf1a78e8
1 changed files with 22 additions and 7 deletions
|
|
@ -248,16 +248,31 @@ scope of a plugin.
|
|||
|
||||
### Testing Plugins
|
||||
|
||||
Making your unpublished plugin available to Packer is possible by either:
|
||||
To install plugins from local source, you can use the `packer plugins install` command with the `--path` flag:
|
||||
|
||||
- Starting Packer from the directory where the plugin binary is located.
|
||||
- Putting the plugin binary in the same directory as Packer.
|
||||
```shell-session
|
||||
$ packer plugins install --path <path-to-binary> <hostname>/<namespace>/<plugin-name>
|
||||
```
|
||||
|
||||
In both these cases, if the binary is called `packer-plugin-myawesomecloud` and
|
||||
defines an `ebs` builder then you will be able to use an `myawesomecloud-ebs`
|
||||
builder or source without needing to have a `required_plugin` block.
|
||||
For example let's install happycloud plugin from a locally sourced binary
|
||||
|
||||
This is extremely useful during development.
|
||||
```shell-session
|
||||
$ packer plugins install --path packer-plugin-happycloud github.com/hashicorp/happycloud
|
||||
```
|
||||
|
||||
This will install the happycloud plugin from the `packer-plugin-happycloud` binary so Packer can discover it.
|
||||
If you want to use this in an HCL2 template, you can optionally add it to the `required_plugins` section like so:
|
||||
|
||||
```hcl
|
||||
required_plugins {
|
||||
happycloud = {
|
||||
source = "github.com/hashicorp/happycloud"
|
||||
version = ">=0.0.1"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For further information on how Packer discovers and loads plugins, you may refer to our [documentation](/packer/docs/plugins/creation/plugin-load-spec) on the subject.
|
||||
|
||||
### Distributing Plugins
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue