Commit Graph

31 Commits

Author SHA1 Message Date
DanHam 8ddbb791a1
Fix typo 2019-08-05 17:25:21 +01:00
Adrien Delorme f555e7a9f2 allow a provisioner to timeout
* 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
2019-04-08 20:09:21 +02:00
Adrien Delorme a81abd297b Merge remote-tracking branch 'origin/master' into context_provisioner 2019-04-08 20:09:01 +02:00
Megan Marsh 1b77b05ce2 remove redundant keep_input_artifact from compress pp and clarify keep behavior in shell-local pp 2019-04-03 12:03:40 -07:00
Adrien Delorme e65115a7a0 contextualize post-processor 2019-04-03 15:55:55 +02:00
Megan Marsh 12fc1fa751 default_keep_input_artifact 2019-04-02 16:51:58 -07:00
Megan Marsh 7e9a653da7 use testify instead of homegrown string compare 2018-05-21 15:26:57 -07:00
Megan Marsh 58acb7f436 fix windows test 2018-05-07 15:10:10 -07:00
Megan Marsh fabd1a6517 windows cmd env vars 2018-05-07 15:10:10 -07:00
Megan Marsh e983a94a88 fix default windows bash call for shell-local provisioner and move chmod command from the execute_command array into the portion of code where we actually generate inline scripts, sparing users the need to think about this modification which Packer should really handle on its own
make bash call work on windows
2018-05-07 15:10:10 -07:00
Megan Marsh 5da4377f21 first pass at docs update 2018-05-07 15:10:10 -07:00
Megan Marsh 854d6fb141 add tests making sure post-processor has backwards compatability 2018-05-07 15:10:10 -07:00
Megan Marsh d304234725 fix tests 2018-05-07 15:10:10 -07:00
Megan Marsh 6dc4b1cbdc move all of the run commands for shell-local provisioner and postprocessor into common library too 2018-05-07 15:10:09 -07:00
Megan Marsh 926327beba deduplicate all validation and interpolation of the shell-local config, sharing options between shell-local provisioner and post-processor. Maintain backwards compatibility with shell-local provisioner. 2018-05-07 15:10:09 -07:00
Megan Marsh 616b41e58f deduplicate the nearly identical communicators for the shell-local provisioner and post-processor, moving single communicator into a new common/shell-local module 2018-05-07 15:10:09 -07:00
Matthew Hooker ebe995c0ff
run goimports 2018-01-22 17:21:10 -08:00
Megan Marsh a7d25cd4c1 remove deprecation warning since we've been talked out of removing shell-local postprocessor 2017-10-12 16:14:15 -07:00
Megan Marsh fa177c52c2 put deprecation warning at end so it isnt lost in scrollback 2017-09-11 16:35:05 -07:00
Megan Marsh 4b7fd33f99 add deprecation warning to shell local provisioner 2017-09-11 16:29:45 -07:00
Matthew Hooker 81522dced0
move packer to hashicorp 2017-04-04 13:39:01 -07:00
DanHam e350739ecb
post-processor/shell-local: expand tests to align with shell provisioner 2017-01-23 22:25:39 +00:00
DanHam 9e480eea49
post-processor/shell-local: Align flattened env vars gen with provisioners
* Move code to generate quoted flattened env vars to separate function
* Fix: generate flattened env vars once per provisioner not once per script
2017-01-23 22:15:51 +00:00
DanHam 5a350f5699
post-processor/shell-local: Fix output of debug info to stdout 2017-01-23 22:08:23 +00:00
Vasiliy Tolstov 332a208fee
post-processor/shell-local: run only once for each builder
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>
2016-12-07 20:54:55 -08:00
Matthew Hooker a05817ee26
fix docs, remove escaping 2016-11-21 16:36:10 -08:00
Matthew Hooker a253cda0aa
should fix #3571 2016-11-09 17:24:48 -08:00
Vasiliy Tolstov b67ee530c8 post-processor/shell-local: don't set executable bit for artifact files (#3505)
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2016-05-18 16:15:26 -07:00
Vasiliy Tolstov feee19e4ed file provisioner improvements
* allow specify source/destination as dir
* allow specify many files as source

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2016-02-12 11:48:28 -08:00
Ian Duffy 5b4e0fe25b Loop through all files in the given artifact and return the given artifact on finish
Signed-off-by: Ian Duffy <ian@ianduffy.ie>
2016-02-01 14:11:25 +00:00
Ian Duffy 34b59bc051 Create a shell-local post processor
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>
2016-02-01 14:11:25 +00:00