From 17691bac10665d4b1357d5347a825e1dfb7c581a Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Tue, 13 Jun 2017 17:09:40 -0400 Subject: [PATCH] website: Packer box version should be variable When using multiple builders, the post-processor could yield different results for the `{{timestamp}}` interpolation. By using a variable instead, the version will be consistent across all builders. https://github.com/hashicorp/packer/issues/4973 --- .../docs/vagrant-cloud/vagrant-cloud-migration.html.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/website/source/docs/vagrant-cloud/vagrant-cloud-migration.html.md b/website/source/docs/vagrant-cloud/vagrant-cloud-migration.html.md index aca3a7993..dc685167b 100644 --- a/website/source/docs/vagrant-cloud/vagrant-cloud-migration.html.md +++ b/website/source/docs/vagrant-cloud/vagrant-cloud-migration.html.md @@ -65,7 +65,8 @@ For example, if your Packer post-processor JSON looks like this: ```json { "variables": { - "atlas_token": "{{env `ATLAS_TOKEN`}}" + "atlas_token": "{{env `ATLAS_TOKEN`}}", + "version": "1.0.{{timestamp}}" }, "builders": [ ], @@ -76,7 +77,7 @@ For example, if your Packer post-processor JSON looks like this: "artifact": "hashicorp/example", "artifact_type": "vagrant.box", "metadata": { - "version": "1.0.{{timestamp}}" + "version": "{{user `version`}}" } } ] @@ -88,7 +89,8 @@ You must replace the `atlas` post-processor with the `vagrant` and `vagrant-clou ```json { "variables": { - "vagrantcloud_token": "{{env `VAGRANTCLOUD_TOKEN`}}" + "vagrantcloud_token": "{{env `VAGRANTCLOUD_TOKEN`}}", + "version": "1.0.{{timestamp}}" }, "builders": [ ], @@ -102,7 +104,7 @@ You must replace the `atlas` post-processor with the `vagrant` and `vagrant-clou "type": "vagrant-cloud", "access_token": "{{user `vagrantcloud_token`}}", "box_tag": "hashicorp/example", - "version": "1.0.{{timestamp}}" + "version": "{{user `version`}}" } ] ]