Commit Graph

33 Commits

Author SHA1 Message Date
Megan Marsh e4f6b6f720 fix chroot communicator to properly escape quotes 2018-08-28 09:16:43 -07:00
Matthew Hooker 81522dced0
move packer to hashicorp 2017-04-04 13:39:01 -07:00
Matthew Hooker cc11ec3566
check for a couple errors 2017-03-28 20:36:21 -07:00
Vasiliy Tolstov feee19e4ed file provisioner improvements
* allow specify source/destination as dir
* allow specify many files as source

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2016-02-12 11:48:28 -08:00
Mitchell Hashimoto 75395af12d Merge branch '1064-fix-upload-file-permissions' of github.com:rasa/packer into rasa-1064-fix-upload-file-permissions
Conflicts:
	builder/parallels/common/step_upload_parallels_tools.go
	builder/vmware/common/step_upload_tools.go
	provisioner/chef-client/provisioner.go
	provisioner/chef-solo/provisioner.go
2014-09-08 13:20:46 -07:00
Brandon Turner b2258dc4e9
Fix chroot builder to work with chef-solo
According to be5adb92b5, the UploadDir
method supports two ways of copying depending on whether a trailing
slash is used:
    src = "dir"  -> dest/dir
    src = "dir/" -> dest

On BSD-based systems (such as OSX, FreeBSD, etc.) the `cp -R` command
handles these two cases automatically.  However, Linux treats "src/" and
"src" the same.

To support the trailing slash syntax portably, we can use:
    src = "dir"   -> dest/dir
    src = "dir/." -> dest

This works on BSD and Linux.  It is better than using wildcards as it
grabs hidden files as well.

This fixes #1196 that prevents the chef-solo provisioner from working
with the chroot builder.
2014-05-27 19:02:29 -05:00
Ross Smith II d92179847d provisioner/file: set file/directory permissions
fixes #1064
2014-05-09 21:03:35 -07:00
Jaime Soriano Pastor 32bb745734 Force LANG=C before appending rest of environment, as only first occurence is used 2014-05-08 17:11:19 +02:00
Nathan Hartwell be5adb92b5 Appending wildcard to src causes problems
It appears that the desired effect was to support
    src = "dir" -> dest/dir
    src = "dir/" -> dest

but cp -R already handles this, provided the trailing slash does not
get consumed by the shell.

The wildcard causes problems when multiple files match the
shell glob, e.g.

UploadDir("/tmp", "./salt*", [])

where my working dir contains
 - salt
 - salt-foo

will error.
2014-05-02 11:18:56 -05:00
Mitchell Hashimoto 3adbd09639 builder/amazon/chroot: fix compile error 2013-11-08 11:19:10 -08:00
Mitchell Hashimoto 3780b57a1f builder/amazon/chroot: allow no such file errors on upload [GH-588] 2013-11-08 10:53:54 -08:00
Mitchell Hashimoto 17f1ee3e98 builder/amazon/chroot: quote commands and pass through a shell [GH-581] 2013-11-08 10:22:56 -08:00
Matthew Hooker 5c41eccfd5 Fix the way we run commands in chroot.
* Single quotes around chroot command cause it to fail.
* The chroot command also gets passed through the CommandWrapper template, so having sudo would clash with however the user wants to run it.
* Fix spelling mistake.
2013-10-01 09:35:55 +00:00
Mitchell Hashimoto 38d3411f80 builder/amazon/chroot: remove unused comment 2013-09-30 09:35:58 -07:00
Mitchell Hashimoto b554a0dd86 builder/amazon/chroot: CommandWrapper
/cc @mwhooker - I changed the interface up a bit to return an error,
since things should return errors in Go (the ui.Error bit was kind of
ghetto because it had no way to bubble that error up except through the
UI).

Using this, I made it so that the communicator uses both a
CommandWrapper and ShellCommand with chroot so that the chroot commannd
is also wrapped (it wasn't before).

I think the functionality of all this is the same but I'd love if you
could look it over and make sure.
2013-09-30 09:33:57 -07:00
Matthew Hooker 5f19648268 comment, formatting. 2013-09-29 08:04:57 +00:00
Matthew Hooker a15f629f4f WIP copying files. 2013-09-28 01:10:33 +00:00
Matthew Hooker 831d5caa50 move wrapper definitions around. 2013-09-27 22:08:15 +00:00
Matthew Hooker 39c3051a95 building but there's an exec error. 2013-09-27 20:47:44 +00:00
Matthew Hooker ac496a63dc replace command config with wrapper command. 2013-09-27 10:54:53 +00:00
Matthew Hooker cebbcc51a6 fix chroot Upload command. 2013-09-27 02:11:28 +00:00
Matthew Hooker 23a331fc00 bugfix. 2013-09-26 01:35:29 -07:00
Matthew Hooker 7740c8fed5 using blocking cp method. 2013-09-26 01:32:53 -07:00
Matthew Hooker 5e9ff92ff3 Revert "notes/reorg."
This reverts commit 73c5aec24d.

Conflicts:
	builder/amazon/chroot/step_copy_files.go
2013-09-26 01:16:51 -07:00
Matthew Hooker ce3725efec wip 2013-09-26 01:08:06 -07:00
Matthew Hooker 7fa238503b wip 2013-09-26 00:58:25 -07:00
Matthew Hooker dd356d33d8 notes/reorg. 2013-09-26 00:31:07 -07:00
Matthew Hooker 5086ff1a4e pass chroot command to /bin/sh
this allows us to specify an arbitrary chroot command, i.e. for sudo
2013-09-25 03:20:22 -07:00
Matthew Hooker 1befba24ed Allow user to override chroot command. 2013-09-17 05:58:16 -07:00
Mitchell Hashimoto d857c9ccbb builder/amazon/chroot: implement UploadDir for chroot communicator 2013-08-25 20:30:56 -07:00
Mitchell Hashimoto be5fa9ecdb builder/amazon/chroot: log the exit code for the chroot communicator 2013-07-30 17:23:37 -07:00
Mitchell Hashimoto 7ae0f3bafe builder/amazon/chroot: upload should os.Create, not os.Open 2013-07-30 16:07:50 -07:00
Mitchell Hashimoto 8d3cf7aa59 builder/amazon/chroot: provision within the chroot 2013-07-30 16:07:50 -07:00