Commit Graph

97 Commits

Author SHA1 Message Date
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
Vadym Haidamaka 0263503c45 Validate virtualbox_version_file and guest_additions_mode when communicator is none 2019-03-16 18:15:27 +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
Megan Marsh 3dc1dafe58
Merge pull request #7287 from stephen-fox/ephemeral-ssh-key-pair-issue-7225
virtualbox: create ephemeral SSH key pair for build process
2019-03-04 14:25:04 -08:00
Megan Marsh 3fd589fa72 typos 2019-02-08 09:31:30 -08:00
Megan Marsh e2d8c0bfd7 docs 2019-02-08 09:28:10 -08:00
Stephen Fox 01c98f3d82 Tweaked debug SSH private key file name for vbox. 2019-02-04 12:47:18 -05:00
Stephen Fox cd4ae03324 Create / use SSH key pairs in vbox builders.
This follows the business logic for creating / using SSH key pairs
in the cloud-type builders (e.g., Amazon EC2).
2019-02-03 12:20:52 -05:00
Megan Marsh 97a791389a deduplicate step_output_dir and move to common folder 2019-01-11 15:06:36 -08:00
Megan Marsh 38cc525ec7 new option allowing user to clean up the ephemeral ssh key from the authorized_keys file 2018-09-14 11:06:38 -07:00
Megan Marsh 340363a649
Merge pull request #6613 from hashicorp/merge_ssh_config_funcs
Merge ssh config funcs from builders
2018-08-23 16:03:36 -07:00
Megan Marsh 918db58604 added new template variables to replace PACKER_KEY_INTERVAL with tunable key and keygroup intervals depending on driver used 2018-08-22 11:37:56 -07:00
Adrien Delorme 41f6e0334d refactor all copy pasted sshConfig with into communicator.Config.SSHConfigFunc
* still need to append the auth methods into an array for gracefullness
2018-08-22 17:02:23 +02:00
Matthew Hooker a0c9ddb9ae
implement boot config struct for virtualbox 2018-04-19 14:26:31 -07:00
Matthew Hooker e4af71858f
Implement new parser for Virtualbox boot command
Remove boot wait for virtualbox run step
2018-04-19 14:26:29 -07:00
Matthew Hooker 49958391b3
better error when source_path doesn't exist. 2018-03-19 09:58:39 -07:00
Josh Soref 041a115f65 spelling: existent 2018-03-13 08:15:56 +00:00
SwampDragons 7d5d62d748
Merge pull request #2906 from arizvisa/GH-2377
Improved support for downloading and validating a uri containing a Windows UNC path or a relative file:// scheme
2018-02-05 09:53:47 -08:00
Matthew Hooker 8cd403425e
test fixes WIP 2018-01-24 17:09:17 -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
Ali Rizvi-Santiago c17f827e1d Split up DownloadableURL() into it's individual components: SupportedURL(), DownloadableURL(), and ValidatedURL(). Updated all instances of DownloadableURL() to point to ValidatedURL(). Reverted the tests that are based on un-supported protocols. 2018-01-16 13:37:32 -06:00
Ali Rizvi-Santiago 3cf448f6ec Reverted previously removed additions of tests that check for ftp:// or nonexistent-protocol:// using DownloadableURL. DownloadableURL's responsibility is not to have inherent knowledge of protocols that are available, but to format an invalid url/path to a valid url/path. 2018-01-16 13:37:32 -06:00
Ali Rizvi-Santiago 5d97b105a8 Removed implementation of the ftp protocol and the usage of cheggaaa's progress-bar as suggested by @SwampDragons. Replaced some of the old smoke-tests that were based on the ftp-protocol non-existing with a "non-existent://" protocol that's guaranteed to not exist. 2018-01-16 13:37:31 -06:00
Ali Rizvi-Santiago e940dc7e42 Fixed a config_test that should've failed but didn't because ftp:// uris work now. HeH! 2018-01-16 13:37:31 -06:00
Megan Marsh 3ace5bb91b simplify FileExistsLocally 2018-01-10 16:11:17 -08:00
Megan Marsh 216c44b153 fix FileExistsLocally 2018-01-09 15:47:07 -08:00
Megan Marsh 4f3b470804 add helper function to manage validation of filepaths created using DownloadableURL 2018-01-03 16:53:47 -08:00
Megan Marsh 6756df9510 use url library instead of parsing string naiively 2017-11-13 12:57:53 -08:00
Megan Marsh 771349e58c fix error message 2017-11-13 12:52:47 -08:00
Megan Marsh 764be03876 didn't mean for this error message to get changed 2017-11-13 12:42:57 -08:00
Megan Marsh 0d18de2942 do validation in vmx config stage 2017-11-13 12:42:57 -08:00
Matthew Hooker fb098d045d
builder/virtualbox-ovf retry removing VM.
moves behavior from builder/virtualbox-iso into the driver
so it is automatically available to callers.
2017-10-25 10:27:33 -07:00
SLAZ666 f6bb79784f Add option keep_registered to virtualbox-ovf builder 2017-09-13 15:37:26 +02:00
Matthew Hooker 81522dced0
move packer to hashicorp 2017-04-04 13:39:01 -07:00
Matthew Hooker 4fcbf75da9
s/non existent/nonexistent/ 2017-03-29 12:38:33 -07:00
Matthew Hooker 230079f73a
spell fixes 2017-03-28 20:36:19 -07:00
Matthew Hooker 68e2b150cd
builder/virtualbox: allow skipping upload of version file 2017-03-16 18:14:11 -07:00
DanHam 0ac071b6e7
Add option to skip export of installed VM for Virtualbox ISO & OVF builders
Closes #4131
2016-12-29 13:19:59 +00:00
DanHam 686ec1866e
vbox builders now need to explicitly set WinRMPort for StepConnect
Aligns vbox builders with changes to helper/communicator/step_connect.go
introduced by PR #2576

Fixes #4310
2016-12-23 15:55:10 +00:00
Arthur Burkart 337856811e Implements OVA downloads w/local checksum support
Presumably, it is convention to store a manifest file with checksums
inside the OVA, so remote checksum support was not implemented.
2016-11-28 15:01:37 -05:00
Rickard von Essen 3c8dabba9e Fixed formatting 2016-10-11 23:43:50 +02:00
Rickard von Essen 5e96709ee9 Merge pull request #2919 from arizvisa/floppy-recurse
Added an option for copying entire subdirectories via floppy_dirs (supplants floppy_files)
2016-10-08 16:51:16 +02:00
Mike Stankavich a187b1cf92 Add VirtualBox post shutdown delay to address floppy controller delete error per issue #2401 2016-10-02 13:12:40 -05:00
Rickard von Essen 29ae078326 Added missing virtualbox floppy_dirs 2016-10-01 09:05:10 +02:00
Orivej Desh 6762965696 Add -on-error command line argument to allow preserving artifacts on builder errors
Resolves #409
2016-09-16 12:15:00 +00:00
Rickard von Essen 5cbc36103e Merge pull request #3756 from ricardclau/floppy_check
Test floppy disks actually exist
2016-09-12 08:05:16 +02:00