Packer post-processor plugin for uploading artifacts to Vagrant Cloud from the input filepath.
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.
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.
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 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.
- Box type, Vagrant provider like
artifact
(string)- Path to artifact file
.box
. to deploy.
- Path to artifact file