Commit Graph

21 Commits

Author SHA1 Message Date
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 2a9f49a5c6 make sure we don't try to load an iso into memory because of a user mistake 2019-02-13 16:21:55 -08:00
Adrien Delorme 6b3844a64f
Revert "allow to use ISO images in-place v.s. copying them" 2018-08-20 10:48:06 +02:00
Adrien Delorme 17f2949e36 remove stuttering; ISOConfig.InplaceISO -> Inplace 2018-08-15 15:51:25 +02:00
Adrien Delorme 82e480a285 allow to use ISO images inplace v.s. copying them 2018-08-15 14:37:38 +02:00
Megan Marsh 5ef8b55559 need log import 2018-07-23 10:34:05 -07:00
Megan Marsh a2f5fbadf6 don't fail if you can't find abs or relative path. 2018-07-23 09:54:25 -07:00
Megan Marsh 0df33cd032 fix relative pathing versus iso checksum dir to work even if user has provided a relative path for the iso_url which is relative to the directory where Packer is run. 2018-07-13 09:21:04 -07:00
Megan Marsh d0f0da6626 allow absolute paths to isos in checksum files 2018-07-13 09:14:59 -07: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
Pavel Boldin 853b04420c iso_config: allow for subdirs in hash sum files
Allow hash sum files and ISOs to be in different directories as
Ubuntu does.

Signed-off-by: Pavel Boldin <boldin.pavel@gmail.com>
2017-11-13 09:28:43 +02:00
Rickard von Essen 97498f80be
core: iso_checksum_url should strip query param
When iso_urls contains query parameters these should be stripped when
searching the content of iso_checksum_url for a maching checksum.

Closes #5176
2017-07-27 07:21:39 +02:00
Matthew Hooker 81522dced0
move packer to hashicorp 2017-04-04 13:39:01 -07:00
Mikhail Zholobov 57d07f227a
Add "iso_target_extension" option for all local *-iso builders
This option allows to set the extension of the ISO file after download.
Defaults to "iso". It makes sense for building Mac OS X guests, where the
bootable image is actually a DMG, not an ISO.
In particular, it is important for "parallels-iso" builder to set the right extension.
2016-12-17 12:50:30 +02:00
Taliesin Sisson e5510873bb Added file with correct line endings
When dealing with windows the file url format is file:///c:/
On windows a lot of git clients will convert LF to CRLF. This would be a problem where file contents are compared exactly
2016-12-12 22:44:51 +00:00
Matthew Hooker 54651e0005 fix parseCheckSumFile panic
resolves #3516
2016-10-14 00:56:05 -07:00
Vasiliy Tolstov 82c63bd723 iso_checksum: fix parsing with absent newline
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2016-07-03 12:06:31 +03:00
Rickard von Essen abb2d92c7e Removed ftp/ftps schemas since they don't work. 2016-02-09 13:02:42 +01:00
Rickard von Essen bbade5d8ae Added "iso_checksum_url" and keep the functionality of "iso_checksum"
Added support for file shema in "iso_checksum_url".
Added some unit tests and updated the docs accordingly.
2016-02-08 19:35:50 +01:00
Vasiliy Tolstov 00fcc3dfdc allow to specify checksum via url
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2016-02-08 19:35:50 +01:00
Mark Peek cdcffecc2d Refactor builder ISO options
The ISO builders (parallels, qemu, virtualbox, and vmware) had too
much common code which needed to be maintained separately. This change
moves that code to a common ISO configuration.
2015-10-20 16:27:47 -07:00