Commit Graph

32 Commits

Author SHA1 Message Date
Adrien Delorme 4399684372 make fmt autogenerated docs 2019-06-06 16:29:25 +02:00
Adrien Delorme e6cbb013ba add // go:generate struct-markdown to all previously edited files 2019-06-05 16:42:18 +02:00
Adrien Delorme f1917edd34 generate the comments for config struct of builders scraping doc website 2019-06-05 16:42:17 +02: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 c4f3dccc14 rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
Adrien Delorme a4bf94dd3c change Builder to be passed a context for cancellation
we have to to give it to our hook
2019-04-03 15:55:55 +02:00
Adrien Delorme 9f82b75e57 Use the hashicorp/go-getter to download files
* removed packer.Cache and references since packer.Cache is never used except in the download step. The download step now uses the new func packer.CachePath(targetPath) for this, the behavior is the same.
* removed download code from packer that was reimplemented into the go-getter library: progress bar, http download restart, checksuming from file, skip already downloaded files, symlinking, make a download cancellable by context.
* on windows if packer is running without symlinking rights and we are getting a local file, the file will be copied instead to avoid errors.
* added unit tests for step_download that are now CI tested on windows, mac & linux.
* files are now downloaded under cache dir `sha1(filename + "?checksum=" + checksum) + file_extension`
* since the output dir is based on the source url and the checksum, when the checksum fails, the file is auto deleted.
* a download file is protected and locked by a file lock,
* updated docs
* updated go modules and vendors
2019-03-13 12:11:58 +01:00
Nye Liu 6d6212b75e Fix issue #6561 - Pass "--config" option correctly to "lxc launch" 2018-08-02 19:37:53 +00:00
Megan Marsh 7253d6547b minor LXD documentation tweaks 2018-03-23 15:46:39 -07:00
Chris Lundquist 4f5e7fe060 first pass at allowing configurable sleep timeouts, profiles, and launch configs 2018-03-20 19:30:46 +00:00
Josh Soref 8c72bba160 spelling: possible 2018-03-14 02:14:18 +00:00
Josh Soref 83471c8399 spelling: doesn't 2018-03-13 07:39:58 +00:00
Matthew Hooker ff64ccda55
Merge pull request #5426 from hashicorp/fix_4915
Fix 4915
2018-02-05 14:54:27 -08:00
Matthew Hooker 7a189a83a1
fix imports
`find . -type f -name '*.go' -not -path "./vendor/*" -exec goimports -w {} \;`
2018-01-24 17:09:17 -08:00
Matthew Hooker a831d522be
change run signatures
Run now takes a context as well as a statebag. We'll assign the context
to the blank identifier to prevent namespace collisions. We'll let the
step authors opt-in to using the context.

`find . -iname "step_*.go" -exec gsed -i'' 's/func \(.*\)Run(/func \1Run(_ context.Context, /' {} \;`
2018-01-24 17:09:17 -08:00
Matthew Hooker 366dc3da0a
move multistep imports to helper.
gomvpkg -from "github.com/mitchellh/multistep" -to "github.com/hashicorp/packer/helper/multistep"
2018-01-24 17:09:15 -08:00
Matthew Hooker ebe995c0ff
run goimports 2018-01-22 17:21:10 -08:00
Chris Lundquist c1a7b3845a [lxd] allow passing of publish properties 2017-10-18 04:57:13 +00:00
Megan Marsh e8cabc1e83 implemented for LXD 2017-10-04 15:23:36 -07:00
Megan Marsh 7f0d253dbf some last minute cleanup 2017-09-05 14:09:15 -07:00
Chris Lundquist f6bc158a80 [lxd] minor fixups for new styles and docs 2017-09-05 12:46:36 -07:00
Chris Lundquist 29bbe10c1c [lxd] rework local tar command to avoid chdir 2017-09-05 12:44:39 -07:00
Chris Lundquist acae8fc2f9 [lxd] implement artifact detroy 2017-09-05 12:44:39 -07:00
Chris Lundquist 68bb72380a [lxd] avoid extra container start/stop and race
Before we couldn't be sure if we were a permanent container or not.
Now we explicitly pass this on the command line so we don't depend on the
extra logic in `lxc publish --force` for ephemeral handling.

This means we avoid restarting the container after we publish
since we tear it down right away anyhow.

Likewise, there was sometimes a race which prevented the deletion
while the container was in a boot stage.
2017-09-05 12:44:39 -07:00
Chris Lundquist e29f06fe1c [lxd] refactor commands to dry things up 2017-09-05 12:44:39 -07:00
Chris Lundquist c79e8ddc8f [lxd] more cleanup 2017-09-05 12:44:39 -07:00
Chris Lundquist 607da30547 [lxd] remove CheckInit 2017-09-05 12:44:39 -07:00
Chris Lundquist 8326d7b6ac [lxd] fixup some publish stuff 2017-09-05 12:44:39 -07:00
Chris Lundquist c62f9a0301 [lxd] cleanup and tweaks 2017-09-05 12:44:39 -07:00
Chris Lundquist 3a0ef7b8b8 [lxd] it 'works' 2017-09-05 12:44:39 -07:00
Chris Lundquist 821cca56a8 [lxd] hack for UploadDir, improve Upload/Download 2017-09-05 12:44:39 -07:00
Chris Lundquist 7366b6c78e [lxd] first pass 2017-09-05 12:44:39 -07:00