update plugin configspec docs

This commit is contained in:
Megan Marsh 2019-12-20 12:05:01 -08:00
parent 3a131b3a03
commit 0649c3f7dc
3 changed files with 25 additions and 1 deletions

View File

@ -36,6 +36,12 @@ type Builder interface {
Run(context.Context, ui Ui, hook Hook) (Artifact, error) Run(context.Context, ui Ui, hook Hook) (Artifact, error)
} }
``` ```
### The "ConfigSpec" Method
This method returns a hcldec.ObjectSpec, which is a spec necessary for using
HCL2 templates with Packer. For information on how to use and implement this
function, check our
[object spec docs](https://www.packer.io/guides/hcl/component-object-spec)
### The "Prepare" Method ### The "Prepare" Method

View File

@ -42,6 +42,13 @@ type PostProcessor interface {
} }
``` ```
### The "ConfigSpec" Method
This method returns a hcldec.ObjectSpec, which is a spec necessary for using
HCL2 templates with Packer. For information on how to use and implement this
function, check our
[object spec docs](https://www.packer.io/guides/hcl/component-object-spec)
### The "Configure" Method ### The "Configure" Method
The `Configure` method for each post-processor is called early in the build The `Configure` method for each post-processor is called early in the build
@ -92,6 +99,6 @@ return value is explained below:
keep the artifact around. keep the artifact around.
- `bool` - If forceOverride is true, then any user input for - `bool` - If forceOverride is true, then any user input for
keep_input_artifact is ignored and the artifact is either kept or discarded keep_input_artifact is ignored and the artifact is either kept or discarded
according to the value set in `keep`. according to the value set in `keep`.
- `error` - Non-nil if there was an error in any way. If this is the case, - `error` - Non-nil if there was an error in any way. If this is the case,
the other two return values are ignored. the other two return values are ignored.

View File

@ -67,6 +67,13 @@ validate the configuration.
The `Prepare` method is called very early in the build process so that errors The `Prepare` method is called very early in the build process so that errors
may be displayed to the user before anything actually happens. may be displayed to the user before anything actually happens.
### The "ConfigSpec" Method
This method returns a hcldec.ObjectSpec, which is a spec necessary for using
HCL2 templates with Packer. For information on how to use and implement this
function, check our
[object spec docs](https://www.packer.io/guides/hcl/component-object-spec)
### The "Provision" Method ### The "Provision" Method
The `Provision` method is called when a machine is running and ready to be The `Provision` method is called when a machine is running and ready to be
@ -79,6 +86,10 @@ connected at this point.
The provision method should not return until provisioning is complete. The provision method should not return until provisioning is complete.
The map[string]interface{} provides users with build-specific information,
like host and IP, provided by the `build` template engine. Provisioners may use
this information however they please, or not use it.
## Using the Communicator ## Using the Communicator
The `packer.Communicator` parameter and interface is used to communicate with The `packer.Communicator` parameter and interface is used to communicate with