github.com/aspring/packer@v0.8.1-0.20150629211158-9db281ac0f89/website/source/docs/post-processors/vagrant-cloud.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Vagrant Cloud Post-Processor"
     4  description: |-
     5    The Packer Vagrant Cloud post-processor receives a Vagrant box from the `vagrant` post-processor and pushes it to Vagrant Cloud. Vagrant Cloud hosts and serves boxes to Vagrant, allowing you to version and distribute boxes to an organization in a simple way.
     6  ---
     7  
     8  # Vagrant Cloud Post-Processor
     9  
    10  Type: `vagrant-cloud`
    11  
    12  The Packer Vagrant Cloud post-processor receives a Vagrant box from the `vagrant`
    13  post-processor and pushes it to Vagrant Cloud. [Vagrant Cloud](https://vagrantcloud.com)
    14  hosts and serves boxes to Vagrant, allowing you to version and distribute
    15  boxes to an organization in a simple way.
    16  
    17  You'll need to be familiar with Vagrant Cloud, have an upgraded account
    18  to enable box hosting, and be distributing your box via the [shorthand name](http://docs.vagrantup.com/v2/cli/box.html)
    19  configuration.
    20  
    21  ## Workflow
    22  
    23  It's important to understand the workflow that using this post-processor
    24  enforces in order to take full advantage of Vagrant and Vagrant Cloud.
    25  
    26  The use of this processor assume that you currently distribute, or plan
    27  to distribute, boxes via Vagrant Cloud. It also assumes you create Vagrant
    28  Boxes and deliver them to your team in some fashion.
    29  
    30  Here is an example workflow:
    31  
    32  1. You use Packer to build a Vagrant Box for the `virtualbox` provider
    33  2. The `vagrant-cloud` post-processor is configured to point to the box `hashicorp/foobar` on Vagrant Cloud
    34  via the `box_tag` configuration
    35  2. The post-processor receives the box from the `vagrant` post-processor
    36  3. It then creates the configured version, or verifies the existence of it, on Vagrant Cloud
    37  4. A provider matching the name of the Vagrant provider is then created
    38  5. The box is uploaded to Vagrant Cloud
    39  6. The upload is verified
    40  7. The version is released and available to users of the box
    41  
    42  
    43  ## Configuration
    44  
    45  The configuration allows you to specify the target box that you have
    46  access to on Vagrant Cloud, as well as authentication and version information.
    47  
    48  ### Required:
    49  
    50  * `access_token` (string) - Your access token for the Vagrant Cloud API.
    51    This can be generated on your [tokens page](https://vagrantcloud.com/account/tokens).
    52  
    53  * `box_tag` (string) - The shorthand tag for your box that maps to
    54     Vagrant Cloud, i.e `hashicorp/precise64` for `vagrantcloud.com/hashicorp/precise64`
    55  
    56  * `version` (string) - The version number, typically incrementing a previous version.
    57    The version string is validated based on [Semantic Versioning](http://semver.org/). The string must match
    58    a pattern that could be semver, and doesn't validate that the version comes after
    59    your previous versions.
    60  
    61  
    62  ### Optional:
    63  
    64  * `no_release` (string) - If set to true, does not release the version
    65  on Vagrant Cloud, making it active. You can manually release the version
    66  via the API or Web UI. Defaults to false.
    67  
    68  * `vagrant_cloud_url` (string) - Override the base URL for Vagrant Cloud. This
    69  is useful if you're using Vagrant Private Cloud in your own network. Defaults
    70  to `https://vagrantcloud.com/api/v1`
    71  
    72  * `version_description` (string) - Optionally markdown text used as a full-length
    73    and in-depth description of the version, typically for denoting changes introduced
    74  
    75  * `box_download_url` (string) - Optional URL for a self-hosted box. If this is set
    76  the box will not be uploaded to the Vagrant Cloud.
    77  
    78  ## Use with Vagrant Post-Processor
    79  
    80  You'll need to use the Vagrant post-processor before using this post-processor.
    81  An example configuration is below. Note the use of a doubly-nested array, which
    82  ensures that the Vagrant Cloud post-processor is run after the Vagrant
    83  post-processor.
    84  
    85  ```javascript
    86  {
    87    "variables": {
    88      "version": "",
    89      "cloud_token": ""
    90    },
    91    "builders": [{
    92        // ...
    93    }],
    94    "post-processors": [
    95      [
    96        {
    97          "type": "vagrant",
    98          "include": ["image.iso"],
    99          "vagrantfile_template": "vagrantfile.tpl",
   100          "output": "proxycore_{{.Provider}}.box"
   101        },
   102        {
   103          "type": "vagrant-cloud",
   104          "box_tag": "hashicorp/precise64",
   105          "access_token": "{{user `cloud_token`}}",
   106          "version": "{{user `version`}}"
   107        }
   108      ]
   109    ]
   110  }
   111  ```