Commit Graph

32 Commits

Author SHA1 Message Date
Adrien Delorme 513999b8e7
Close tty on exit (#7411) 2019-03-15 11:10:30 +01: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
Adrien Delorme 55261f1bf3 Update ui_test.go
fix typo and tty usage
2019-03-06 16:09:08 +01:00
Adrien Delorme 22df491c67 mock tty using interfaces to test more easily 2019-02-28 14:40:55 +01:00
Josh Soref c49c40ac41 spelling: targeted 2018-03-14 03:24:39 +00:00
Josh Soref 785b42368d spelling: easily 2018-03-13 07:40:52 +00:00
Matthew Hooker 048e316645
s/TargettedUi/TargetedUI/ 2017-03-29 12:44:42 -07:00
Ash Berlin 242ed49ecb Use bufio.Scanner in BasicUi.Ask so we can read whole lines
The previous version used fmt.Fscanln which sounds like it should scan
for a whole line, but it actually errors if there is more than a single
word/token given. You can see this here https://play.golang.org/p/1RYXdtPSbk

And looking at the only usage of this function in core it won't break
anything to change it to actually return whole lines instead.

    line, err := ui.Ask("[c] Clean up and exit, [a] abort without cleanup, or [r] retry step (build may fail even if retry succeeds)?")

Closes #4474
2017-01-29 14:10:14 +00:00
Emil Hessman bd425db546 packer: skip colored ui test if ui doesn't support colors
Fixes test failure on Windows.
2015-04-07 20:33:58 +02:00
Mitchell Hashimoto f3494fc77a fmt 2014-02-21 20:02:55 -08:00
Mitchell Hashimoto e2e4c9f671 packer: errors go to stderr [GH-868] 2014-02-21 18:29:15 -08:00
Mitchell Hashimoto ecf211ceed paker: tests for ColoredUi not showing color with env vars 2013-12-18 08:40:35 -08:00
Mitchell Hashimoto c7d7e2cf0f packer: don't change background color in UI 2013-11-19 21:31:54 -08:00
Mitchell Hashimoto 386d72c31a packer: no more asserts lib 2013-10-16 21:09:27 -10:00
Mitchell Hashimoto ba3344a322 packer: replace new lines with literal \n 2013-08-11 23:18:14 -07:00
Mitchell Hashimoto aa143a330b packer: TargettedUi properly targets machine-readable data 2013-08-11 19:08:08 -07:00
Mitchell Hashimoto 89be12ae21 packer: Add MachineReadableUi 2013-08-11 19:05:07 -07:00
Mitchell Hashimoto 03c10a9aa8 packer: renamed PrefixedUi to TargettedUi 2013-08-11 18:31:28 -07:00
Mitchell Hashimoto 02edc7579b packer: Rename ReaderWriterUi to BasicUi 2013-08-11 18:20:27 -07:00
Mitchell Hashimoto 7198936f7e packer: PrefixedUi properly prefixes each line of output 2013-07-02 12:28:25 -07:00
Mitchell Hashimoto e0f2bcf8a2 packer: Add "Ask" method to Ui to ask for input 2013-06-14 15:17:03 -07:00
Mitchell Hashimoto 0f98852d4d packer: Ui error output is red 2013-06-12 10:41:58 -07:00
Mitchell Hashimoto 079d6f4d43 packer: Introduce Cancel() method to Builder 2013-06-03 14:44:34 -07:00
Mitchell Hashimoto f041ebb2fd packer: ColoredUi 2013-06-03 13:35:43 -07:00
Mitchell Hashimoto edab952a68 packer: Add Message method to Ui 2013-06-03 11:30:38 -07:00
Mitchell Hashimoto 2788d29bd1 packer, packer/rpc: Update Ui to just take a message 2013-05-27 15:12:48 -07:00
Mitchell Hashimoto 2c4a873a5f packer: Add PrefixedUi 2013-05-21 13:20:51 -07:00
Mitchell Hashimoto 559777e5b7 packer: Ui automatically appends newline 2013-05-20 23:43:37 -07:00
Mitchell Hashimoto 95153413a6 packer: Ui has Error method 2013-05-08 15:12:48 -07:00
Mitchell Hashimoto f579ff05f2 Initial work on Build 2013-04-20 19:55:02 -06:00
Mitchell Hashimoto 91c524c7ec More environment testing 2013-03-24 14:47:59 -07:00
Mitchell Hashimoto ca93f645be packer.Ui tests 2013-03-24 14:31:18 -07:00