github.com/mmcquillan/packer@v1.1.1-0.20171009221028-c85cf0483a5d/website/source/docs/templates/push.html.md (about)

     1  ---
     2  description: |
     3      Within the template, the push section configures how a template can be pushed
     4      to a remote build service.
     5  layout: docs
     6  page_title: 'Push - Templates'
     7  sidebar_current: 'docs-templates-push'
     8  ---
     9  
    10  # Template Push
    11  
    12  Within the template, the push section configures how a template can be
    13  [pushed](/docs/commands/push.html) to a remote build service.
    14  
    15  Push configuration is responsible for defining what files are required to build
    16  this template, what the name of build configuration is in the build service,
    17  etc.
    18  
    19  The only build service that Packer can currently push to is
    20  [Atlas](https://atlas.hashicorp.com) by HashiCorp. Support for other build
    21  services will come in the form of plugins in the future.
    22  
    23  Within a template, a push configuration section looks like this:
    24  
    25  ``` json
    26  {
    27    "push": {
    28      // ... push configuration here
    29    }
    30  }
    31  ```
    32  
    33  ## Configuration Reference
    34  
    35  There are many configuration options available for the builder. They are
    36  segmented below into two categories: required and optional parameters. Within
    37  each category, the available configuration keys are alphabetized.
    38  
    39  ### Required
    40  
    41  -   `name` (string) - Name of the build configuration in the build service. If
    42      this doesn't exist, it will be created (by default). Note that the name
    43      cannot contain dots. `[a-zA-Z0-9-_/]+` are safe.
    44  
    45  ### Optional
    46  
    47  -   `address` (string) - The address of the build service to use. By default
    48      this is `https://atlas.hashicorp.com`.
    49  
    50  -   `base_dir` (string) - The base directory of the files to upload. This will
    51      be the current working directory when the build service executes
    52      your template. This path is relative to the template.
    53  
    54  -   `include` (array of strings) - Glob patterns to include relative to the
    55      `base_dir`. If this is specified, only files that match the include pattern
    56      are included.
    57  
    58  -   `exclude` (array of strings) - Glob patterns to exclude relative to the
    59      `base_dir`.
    60  
    61  -   `token` (string) - An access token to use to authenticate to the
    62      build service.
    63  
    64  -   `vcs` (boolean) - If true, Packer will detect your VCS (if there is one) and
    65      only upload the files that are tracked by the VCS. This is useful for
    66      automatically excluding ignored files. This defaults to false.
    67  
    68  ## Examples
    69  
    70  A push configuration section with minimal options:
    71  
    72  ``` json
    73  {
    74    "push": {
    75      "name": "hashicorp/precise64"
    76    }
    77  }
    78  ```
    79  
    80  A push configuration specifying Packer to inspect the VCS and list individual
    81  files to include:
    82  
    83  ``` json
    84  {
    85    "push": {
    86      "name": "hashicorp/precise64",
    87      "vcs": true,
    88      "include": [
    89        "other_file/outside_of.vcs"
    90      ]
    91    }
    92  }
    93  ```