This is where that bracket issue you found on another thread comes into
play.

Instead of

  "post-processors": [
>     {
>       "type": "shell-local",
>       "script": "create-cloudbox.sh"
>     },
>     {
>       "output": "{{ user `build_directory` }}/{{user
> `box_basename`}}.{{.Provider}}.box",
>       "type": "vagrant"
>     },
>     {
>       "type": "vagrant-cloud",
>       "box_tag": "username/nameofmybox",
>       "access_token": "{{user `cloud_token`}}",
>       "version": "{{user `version`}}"
>     }
>   ],


You need

  "post-processors": [[
>     {
>       "type": "shell-local",
>       "script": "create-cloudbox.sh"
>     },
>     {
>       "output": "{{ user `build_directory` }}/{{user
> `box_basename`}}.{{.Provider}}.box",
>       "type": "vagrant"
>     },
>     {
>       "type": "vagrant-cloud",
>       "box_tag": "username/nameofmybox",
>       "access_token": "{{user `cloud_token`}}",
>       "version": "{{user `version`}}"
>     }
>   ]],


Any post-processors only wrapped in the first set of brackets will get the
build artifact as its input.

Any post-processors inside the second set of brackets will run in order,
with the output artifact from one post-processor becoming the input
artifact to the next.

Why?

The double-bracketing doesn't make intuitive sense in a single-flow context
like yours, but it allows users to create multiple output artifacts using
different postprocessor flows from the same build artifact.

So, for example, you could take the same vmware artifact and both create a
vagrant box that you upload to vagrant cloud in one flow like you're doing
here, but then, and in another flow upload it to vsphere, and the
postprocessors wouldn't get in each other's ways.

For a little more detail on sequencing, you can see the docs at
https://www.packer.io/docs/templates/post-processors/#post-processor-definition

Hope this helps!

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CAGPV1uqVNrMFr0AC44KvCQbDsRqNFP4E%2BU-ZVkPsaD%2BwpxeVtA%40mail.gmail.com.

Reply via email to