37 Commits

Author SHA1 Message Date
Wilken Rivera
9ec8b67392
Add golangci-lint to project (#8686)
* Add golangci-lint as linting tool

* Disable failing staticchecks to start; GitHub issue to handle coming soon

* Run `goimports -w` to repair all source files that have improperly
formatted imports

* makefile: Add ci-lint target to run on travis

This change adds a new make target for running golangci-lint on newly
added Go files only. This target is expected to run during Packer ci builds.

* .github/contributing: Add code linting instructions

* travis: Update job configuration to run parallel builds
2020-02-14 11:42:29 -05:00
Sylvia Moss
0b7251a4bb
Share .Device and .MountPath between builders, provisioners and post-processors (#8621) 2020-01-20 16:29:38 +01:00
Paul Meyer
e6dfe301ac Move CommandWrapper & ShellCommand to common 2019-10-24 04:06:29 +00:00
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
Sargun Dhillon
d3c65ee77d builder/amazon/chroot: Fix building PV images with mount_partition
Right now, if we have a source image that's PV, and try to build an
image with mount_partition set to not 0, it does not get picked up.
This is because under PV we only had a filesystem, not partitions,
but you can convert a PV image to an HVM image during build time.
2019-02-22 18:21:01 -08:00
Megan Marsh
e670eed315 Add new option, nvme_device_path, so that we can properly mount nvme block devices. 2018-05-23 09:16:40 -07:00
Megan Marsh
59e3ec722d allow user to mount entire block device in chroot builder 2018-04-25 10:47:52 -07: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
81522dced0
move packer to hashicorp 2017-04-04 13:39:01 -07:00
Matthew Hooker
230079f73a
spell fixes 2017-03-28 20:36:19 -07:00
Jeremy Asher
5e8b697a76 add from_scratch option to amazon-chroot builder
This provides an alternate mode for the amazon-chroot builder which uses
a blank volume to build the image.  It adds StepPreMountCommands to
permit partitioning and format commands to be executed before mounting
the new volume.
2016-09-03 12:28:22 -07:00
Kimo Rosenbaum
09543fc4e7 Add mount_partition to amazon-chroot builder to specify a partition other than 1 2016-01-06 11:35:01 -08:00
Clint Shryock
3a54e6899d code cleanup 2015-06-23 11:34:42 -05:00
Clint Shryock
29cef0eae4 builder/amazon-chroot: add mount_options configuration option 2015-06-23 11:26:13 -05:00
Mitchell Hashimoto
84189f7a28 builder/*: properly save interpolation context 2015-06-22 09:22:42 -07:00
Seth Vargo
33ca8b7fb5 Migrate to new AWS repo 2015-06-03 17:13:52 -04:00
Mitchell Hashimoto
44b980e659 Merge branch 'aws-sdk-go' of https://github.com/jen20/packer into jen20-aws-sdk-go 2015-05-28 08:24:41 -07:00
Mitchell Hashimoto
034e4e676c amazon/*: use new interpolation functions 2015-05-27 11:47:45 -07:00
James Nugent
e99cd56b6c Migrate from mitchellh/goamz to awslabs/aws-sdk-go
This commit moves the Amazon builders of Packer away from the Hashicorp
fork of the goamz library to the official AWS SDK for Go, in order that
third party plugins may depend on the more complete official library
more easily.
2015-04-12 21:33:09 -04:00
Peter Sankauskas
460e2da248 The mount command for a PV image that is attached to /dev/sdf is:
mount /dev/xvdf /mnt/point
while for an HVM image that is attached to /dev/sdf, its mount command is
mount /dev/xvdf1 /mnt/point
so this code enabled that
2014-07-29 21:55:20 -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
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
d2f9ba0d11 fixing up types. 2013-09-27 11:55:19 +00:00
Matthew Hooker
ac496a63dc replace command config with wrapper command. 2013-09-27 10:54:53 +00:00
Mitchell Hashimoto
80ed7eddf4 builder/amazon/chroot: new multistep API 2013-08-31 12:58:55 -07:00
Mitchell Hashimoto
5f34ec0ebc builder/amazon/chroot: switch to new template stuff 2013-08-08 17:25:25 -07:00
Mitchell Hashimoto
743682d352 builder/amazon/chroot: default volumes dir is relative 2013-07-30 22:31:07 -07:00
Mitchell Hashimoto
3667340768 builder/amazon/chroot: switch func type to interface
Was getting weird behavior... see
https://groups.google.com/d/msg/golang-nuts/a1kymwSVt2M/FwcCuBl1_48
2013-07-30 17:56:42 -07:00
Mitchell Hashimoto
056292b1dc builder/amazon/chroot: perform early cleanup 2013-07-30 16:41:29 -07:00
Mitchell Hashimoto
af2d314819 builder/amazon/chroot: /bin/sh 2013-07-30 16:07:50 -07:00
Mitchell Hashimoto
d7f932244f builder/amazon/chroot: mount extra paths 2013-07-30 16:07:50 -07:00
Mitchell Hashimoto
618e1b1678 builder/amazon/chroot: process MountPath template 2013-07-30 16:07:49 -07:00
Mitchell Hashimoto
54d020b8c3 builder/amazon/chroot: use mountcommand configs 2013-07-30 16:07:49 -07:00
Mitchell Hashimoto
1c34e35574 builder/amazon/chroot: mount the root device 2013-07-30 16:07:49 -07:00