website: update latest post-processor API

This commit is contained in:
Mitchell Hashimoto 2013-07-01 11:35:09 -07:00
parent f78cbb45a6
commit 8e9e596935
1 changed files with 13 additions and 1 deletions

View File

@ -38,7 +38,7 @@ what each method should do.
<pre class="prettyprint"> <pre class="prettyprint">
type PostProcessor interface { type PostProcessor interface {
Configure(interface{}) error Configure(interface{}) error
PostProcess(Ui, Artifact) (Artifact, error) PostProcess(Ui, Artifact) (a Artifact, keep bool, err error)
} }
</pre> </pre>
@ -79,3 +79,15 @@ a "compress" post-processor that is responsible for compressing files,
the transformation would be taking the `Files()` from the original artifact, the transformation would be taking the `Files()` from the original artifact,
compressing them, and creating a new artifact with a single file: the compressing them, and creating a new artifact with a single file: the
compressed archive. compressed archive.
The result signature of this method is `(Artifact, bool, error)`. Each
return value is explained below:
* `Artifact` - The newly created artifact if no errors occurred.
* `bool` - If true, the input artifact will forcefully be kept. By default,
Packer typically deletes all input artifacts, since the user doesn't generally
want intermediary artifacts. However, some post-processors depend on the
previous artifact existing. If this is `true`, it forces packer to keep the
artifact around.
* `error` - Non-nil if there was an error in any way. If this is the case,
the other two return values are ignored.