Skip to content

Packer post-processor plugin to upload artifacts to Vagrant Cloud from the input filepath (without a requirement of using 'vagrant' post-processor). Useful to split Packer build/deploy stage.

License

Notifications You must be signed in to change notification settings

arm4b/packer-post-processor-vagrant-cloud-standalone

Repository files navigation

vagrant-cloud-standalone

Build Status GitHub release License

Packer post-processor plugin for uploading artifacts to Vagrant Cloud from the input filepath.

Description

This post-processor is a fork of core Packer's vagrant-cloud plugin (source code).

While original vagrant-cloud plugin requires artifact produced from the previous vagrant post-processor involving entire build stage, forked version vagrant-cloud-standalone just uploads artifact to Vagrant Cloud directly by input filepath, hence standalone.

It can be useful to split Packer build/deploy stage if you prefer to divide CI/CD or when artifact was already produced before.

Installation

Packer supports pluggable mechanism. Please read the following documentation to understand how to install this plugin:

https://www.packer.io/docs/extend/plugins.html

You can download binary built for your architecture from Github Releases.

Usage

Here is a simple example of vagrant_deploy.json:

{
  "variables": {
    "description": "Packer template for deploying a .box artifact to Vagrant CLoud",
    "cloud_token": "{{ env `VAGRANT_CLOUD_TOKEN` }}"
  },
  "builders": [
    {
      "type": "file",
      "content": "Do nothing, Packer just requires at least one builder to be present",
      "target": "/dev/null"
    }
  ],
  "post-processors": [
    {
      "type": "vagrant-cloud-standalone",
      "access_token": "{{user `cloud_token`}}",
      "box_tag": "ubuntu/xenial64",
      "provider": "virtualbox",
      "version": "20180130.0.0",
      "artifact": "builds/ubuntu-xenial_v20180130.0.0.box"
    }
  ]
}

It will verify the box, create new Version, Provider, Upload the provided .box and then Release new version in Vagrant Cloud.

Configuration

Configuration is the same as original Packer's vagrant-cloud.

A few settings were added to allow uploading .box artifact from the local file path:

  • provider (string)
    • Box type, Vagrant provider like virtualbox, vmware, hyperv etc.
  • artifact (string)
    • Path to artifact file .box. to deploy.

About

Packer post-processor plugin to upload artifacts to Vagrant Cloud from the input filepath (without a requirement of using 'vagrant' post-processor). Useful to split Packer build/deploy stage.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages