Commit 8f2a9de2 authored by Chris Bednarski's avatar Chris Bednarski

Updated documentation explaining how to use variables in compress post-processor filenames

parent 4ef3baa3
...@@ -15,10 +15,11 @@ VMware or VirtualBox) and compresses the artifact into a single archive. ...@@ -15,10 +15,11 @@ VMware or VirtualBox) and compresses the artifact into a single archive.
## Configuration ## Configuration
### Required: ### Optional:
You must specify the output filename. The archive format is derived from the By default, packer will build archives in `.tar.gz` format with the following
filename. filename: `packer_{{.BuildName}}_{{.BuilderType}}`. If you want to change this
you will need to specify the `output` option.
- `output` (string) - The path to save the compressed archive. The archive - `output` (string) - The path to save the compressed archive. The archive
format is inferred from the filename. E.g. `.tar.gz` will be a format is inferred from the filename. E.g. `.tar.gz` will be a
...@@ -26,13 +27,9 @@ filename. ...@@ -26,13 +27,9 @@ filename.
detected packer defaults to `.tar.gz` behavior but will not change detected packer defaults to `.tar.gz` behavior but will not change
the filename. the filename.
If you are executing multiple builders in parallel you should make sure `output` You can use `{{.BuildName}}` and ``{{.BuilderType}}` in your output path.
is unique for each one. For example `packer_{{.BuildName}}_{{.Provider}}.zip`. If you are executing multiple builders in parallel you should make sure
`output` is unique for each one. For example `packer_{{.BuildName}}.zip`.
### Optional:
If you want more control over how the archive is created you can specify the
following settings:
- `compression_level` (integer) - Specify the compression level, for - `compression_level` (integer) - Specify the compression level, for
algorithms that support it, from 1 through 9 inclusive. Typically higher algorithms that support it, from 1 through 9 inclusive. Typically higher
...@@ -61,14 +58,14 @@ configuration: ...@@ -61,14 +58,14 @@ configuration:
``` {.json} ``` {.json}
{ {
"type": "compress", "type": "compress",
"output": "archive.zip" "output": "{{.BuildName}}_bundle.zip"
} }
``` ```
``` {.json} ``` {.json}
{ {
"type": "compress", "type": "compress",
"output": "archive.gz", "output": "log_{{.BuildName}}.gz",
"compression": 9 "compression": 9
} }
``` ```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment