* I had to contextualise Communicator.Start and RemoteCmd.StartWithUi
NOTE: Communicator.Start starts a RemoteCmd but RemoteCmd.StartWithUi will run the cmd and wait for a return, so I renamed StartWithUi to RunWithUi so that the intent is clearer.
Ideally in the future RunWithUi will be named back to StartWithUi and the exit status or wait funcs of the command will allow to wait for a return. If you do so please read carrefully https://golang.org/pkg/os/exec/#Cmd.Stdout to avoid a deadlock
* cmd.ExitStatus to cmd.ExitStatus() is now blocking to avoid race conditions
* also had to simplify StartWithUi
don't run post-processor for each artifact file, but only for
each builder to be consistent with other post-processors
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
The following commits build on work from @vtolstov to create a
post processor shell-local plugin. Please see his original work
over at https://github.com/vtolstov/packer-post-processor-shell
I have modified it slightly to output information onto the packer
ui as shown in the below screenshot which executes a script that
runs env.
This plugin enables users to submit environmental variables to
external external shell script(s) to do some post processing
e.g. (Upload to somewhere, convert to different format, and so
on)
Most of the work is a merge from the provisioner shell and
shell-local scripts.
![Example run of post processor shell-local](http://i.imgur.com/kJv6j9l.png)
Signed-off-by: Ian Duffy <ian@ianduffy.ie>