github.com/kikitux/packer@v0.10.1-0.20160322154024-6237df566f9f/website/source/docs/post-processors/compress.html.md (about)

     1  ---
     2  description: |
     3      The Packer compress post-processor takes an artifact with files (such as from
     4      VMware or VirtualBox) and compresses the artifact into a single archive.
     5  layout: docs
     6  page_title: 'compress Post-Processor'
     7  ...
     8  
     9  # Compress Post-Processor
    10  
    11  Type: `compress`
    12  
    13  The Packer compress post-processor takes an artifact with files (such as from
    14  VMware or VirtualBox) and compresses the artifact into a single archive.
    15  
    16  ## Configuration
    17  
    18  ### Optional:
    19  
    20  By default, packer will build archives in `.tar.gz` format with the following
    21  filename: `packer_{{.BuildName}}_{{.BuilderType}}`. If you want to change this
    22  you will need to specify the `output` option.
    23  
    24  -   `output` (string) - The path to save the compressed archive. The archive
    25      format is inferred from the filename. E.g. `.tar.gz` will be a
    26      gzipped tarball. `.zip` will be a zip file. If the extension can't be
    27      detected packer defaults to `.tar.gz` behavior but will not change
    28      the filename.
    29  
    30      You can use `{{.BuildName}}` and `{{.BuilderType}}` in your output path. If
    31      you are executing multiple builders in parallel you should make sure
    32      `output` is unique for each one. For example `packer_{{.BuildName}}.zip`.
    33  
    34  -   `compression_level` (integer) - Specify the compression level, for
    35      algorithms that support it, from 1 through 9 inclusive. Typically higher
    36      compression levels take longer but produce smaller files. Defaults to `6`
    37  
    38  -   `keep_input_artifact` (boolean) - Keep source files; defaults to `false`
    39  
    40  ### Supported Formats
    41  
    42  Supported file extensions include `.zip`, `.tar`, `.gz`, `.tar.gz`, `.lz4` and
    43  `.tar.lz4`. Note that `.gz` and `.lz4` will fail if you have multiple files to
    44  compress.
    45  
    46  ## Examples
    47  
    48  Some minimal examples are shown below, showing only the post-processor
    49  configuration:
    50  
    51  ``` {.json}
    52  {
    53    "type": "compress",
    54    "output": "archive.tar.lz4"
    55  }
    56  ```
    57  
    58  ``` {.json}
    59  {
    60    "type": "compress",
    61    "output": "{{.BuildName}}_bundle.zip"
    62  }
    63  ```
    64  
    65  ``` {.json}
    66  {
    67    "type": "compress",
    68    "output": "log_{{.BuildName}}.gz",
    69    "compression_level": 9
    70  }
    71  ```