docs: add installing plugins from a compiled binary example

pull/13317/head
Karthik P 1 year ago committed by GitHub
parent 736a6cbc98
commit 1896739a4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -247,16 +247,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>
```
For example let's install happycloud plugin from a locally sourced binary
```shell-session
$ packer plugins install --path packer-plugin-happycloud github.com/hashicorp/happycloud
```
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.
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"
}
}
```
This is extremely useful during development.
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…
Cancel
Save