14 Commits

Author SHA1 Message Date
Adrien Delorme
72c2731f7b Update step_download_test.go 2020-02-06 18:24:13 +01:00
Adrien Delorme
973a1ea103 remove comented code 2020-02-06 18:23:08 +01:00
Adrien Delorme
d45eca5cdc update tests 2020-02-06 18:17:57 +01:00
Adrien Delorme
a19214afeb Allow to use isos in place 2020-02-06 17:07:58 +01:00
Moss
f2c8e8491c Fix format 2020-02-04 18:22:43 +01:00
Moss
e020da49f3 Add iso file name when targetPath is absolute 2020-02-04 18:06:47 +01:00
Megan Marsh
90bdcf58bd update step_download to return an ActionContinue if the URls field is empty. this allows us to simplify the hyperv builder, and is still safe because all other builders and uses of step_download already validate that the iso url is not empty if that's what they need, most of them inside of the IsoConfig prepare function. 2020-01-07 10:45:24 -08:00
Megan Marsh
e9549d2688 add test for local fs download 2019-07-22 09:17:48 -07:00
Adrien Delorme
5f0259fe89 step download: don't fail when checksum_type is not set 2019-04-16 18:09:54 +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
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
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
Mitchell Hashimoto
bb352e5011 common: Add new StepDownload to DRY up downloads 2013-08-15 17:46:40 -07:00