Commit Graph

122 Commits

Author SHA1 Message Date
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
Jake Champlin 2d3ee06ecd Remove LGPL dependencies
This changeset performs the following:

- Updates `masterzen/winrm` vendor to include change from (https://github.com/masterzen/winrm/pull/73).
- Removes `masterzen/xmlpath` dependency, as it is licensed under the LGPL license.
- Updates `dylanmei/winrmtest` vendor to include change from (https://github.com/dylanmei/winrmtest/pull/4).
- Updates `packer-community/winrmcp` vendor to include the removal of the `masterzen/winrm/winrm` sub-class as a result of the `winrm` CLI tool being removed from the `masterzen/winrm` repository.
- Updates nested dependencies as a result of the above vendor changes.
- Refactors `parallels/driver_9` to use `goxpath` instead of `xmlpath`, as `xmlpath` is licensed under LGPL.
- Adds a basic unit test for the refactor work in `parallels/driver_9` to confirm functionality.

This should completely remove any LGPL licensed dependencies inside of the Packer project.

```
$ make test
/home/jake/src/go/src/github.com/hashicorp/packer/scripts/gofmtcheck.sh $(find . -not -path "./vendor/*" -name "*.go")
==> Checking that code complies with gofmt requirements...
Check passed.
ok      github.com/hashicorp/packer     0.044s
ok      github.com/hashicorp/packer/builder/alicloud/ecs        0.055s
ok      github.com/hashicorp/packer/builder/amazon/chroot       0.040s
ok      github.com/hashicorp/packer/builder/amazon/common       0.021s
ok      github.com/hashicorp/packer/builder/amazon/ebs  0.016s
ok      github.com/hashicorp/packer/builder/amazon/ebssurrogate 0.015s
ok      github.com/hashicorp/packer/builder/amazon/ebsvolume    0.014s
ok      github.com/hashicorp/packer/builder/amazon/instance     0.058s
ok      github.com/hashicorp/packer/builder/azure/arm   2.833s
ok      github.com/hashicorp/packer/builder/azure/common        0.018s
?       github.com/hashicorp/packer/builder/azure/common/constants      [no test files]
?       github.com/hashicorp/packer/builder/azure/common/lin    [no test files]
?       github.com/hashicorp/packer/builder/azure/common/logutil        [no test files]
ok      github.com/hashicorp/packer/builder/azure/common/template       0.038s
ok      github.com/hashicorp/packer/builder/azure/pkcs12        0.120s
ok      github.com/hashicorp/packer/builder/azure/pkcs12/rc2    0.020s
ok      github.com/hashicorp/packer/builder/cloudstack  0.038s
ok      github.com/hashicorp/packer/builder/digitalocean        0.015s
ok      github.com/hashicorp/packer/builder/docker      0.028s
ok      github.com/hashicorp/packer/builder/file        0.029s
ok      github.com/hashicorp/packer/builder/googlecompute       3.162s
ok      github.com/hashicorp/packer/builder/hyperv/common       0.006s
ok      github.com/hashicorp/packer/builder/hyperv/iso  0.042s
ok      github.com/hashicorp/packer/builder/null        0.018s
ok      github.com/hashicorp/packer/builder/oneandone   0.022s
ok      github.com/hashicorp/packer/builder/openstack   0.052s
ok      github.com/hashicorp/packer/builder/parallels/common    2.549s
ok      github.com/hashicorp/packer/builder/parallels/iso       0.050s
ok      github.com/hashicorp/packer/builder/parallels/pvm       0.033s
ok      github.com/hashicorp/packer/builder/profitbricks        0.023s
ok      github.com/hashicorp/packer/builder/qemu        0.039s
ok      github.com/hashicorp/packer/builder/triton      0.018s
ok      github.com/hashicorp/packer/builder/virtualbox/common   5.533s
ok      github.com/hashicorp/packer/builder/virtualbox/iso      0.044s
ok      github.com/hashicorp/packer/builder/virtualbox/ovf      0.012s
ok      github.com/hashicorp/packer/builder/vmware/common       5.325s
ok      github.com/hashicorp/packer/builder/vmware/iso  0.076s
ok      github.com/hashicorp/packer/builder/vmware/vmx  0.010s
ok      github.com/hashicorp/packer/command     0.062s
ok      github.com/hashicorp/packer/common      0.053s
ok      github.com/hashicorp/packer/common/json 0.003s [no tests to run]
ok      github.com/hashicorp/packer/common/powershell   0.015s
?       github.com/hashicorp/packer/common/powershell/hyperv    [no test files]
?       github.com/hashicorp/packer/common/ssh  [no test files]
ok      github.com/hashicorp/packer/common/uuid 0.010s
ok      github.com/hashicorp/packer/communicator/none   0.008s
ok      github.com/hashicorp/packer/communicator/ssh    0.068s
ok      github.com/hashicorp/packer/communicator/winrm  0.046s
ok      github.com/hashicorp/packer/fix 0.005s
ok      github.com/hashicorp/packer/helper/builder/testing      0.007s
ok      github.com/hashicorp/packer/helper/communicator 0.013s
ok      github.com/hashicorp/packer/helper/config       0.004s
?       github.com/hashicorp/packer/helper/enumflag     [no test files]
ok      github.com/hashicorp/packer/helper/flag-kv      0.009s
ok      github.com/hashicorp/packer/helper/flag-slice   0.006s
ok      github.com/hashicorp/packer/packer      0.219s
ok      github.com/hashicorp/packer/packer/plugin       0.233s
ok      github.com/hashicorp/packer/packer/rpc  0.141s
ok      github.com/hashicorp/packer/plugin/example      0.008s [no tests to run]
?       github.com/hashicorp/packer/post-processor/alicloud-import      [no test files]
?       github.com/hashicorp/packer/post-processor/amazon-import        [no test files]
ok      github.com/hashicorp/packer/post-processor/artifice     0.003s [no tests to run]
ok      github.com/hashicorp/packer/post-processor/atlas        0.018s
ok      github.com/hashicorp/packer/post-processor/checksum     0.015s
ok      github.com/hashicorp/packer/post-processor/compress     0.047s
ok      github.com/hashicorp/packer/post-processor/docker-import        0.012s
ok      github.com/hashicorp/packer/post-processor/docker-push  0.012s
ok      github.com/hashicorp/packer/post-processor/docker-save  0.008s
ok      github.com/hashicorp/packer/post-processor/docker-tag   0.008s
ok      github.com/hashicorp/packer/post-processor/googlecompute-export 0.015s [no tests to run]
?       github.com/hashicorp/packer/post-processor/manifest     [no test files]
ok      github.com/hashicorp/packer/post-processor/shell-local  0.028s
ok      github.com/hashicorp/packer/post-processor/vagrant      0.030s
ok      github.com/hashicorp/packer/post-processor/vagrant-cloud        0.028s
ok      github.com/hashicorp/packer/post-processor/vsphere      0.014s
ok      github.com/hashicorp/packer/provisioner 0.011s
ok      github.com/hashicorp/packer/provisioner/ansible 0.140s
ok      github.com/hashicorp/packer/provisioner/ansible-local   0.056s
ok      github.com/hashicorp/packer/provisioner/chef-client     0.050s
ok      github.com/hashicorp/packer/provisioner/chef-solo       0.061s
ok      github.com/hashicorp/packer/provisioner/converge        0.018s
ok      github.com/hashicorp/packer/provisioner/file    0.015s
ok      github.com/hashicorp/packer/provisioner/powershell      0.168s
ok      github.com/hashicorp/packer/provisioner/puppet-masterless       0.008s
ok      github.com/hashicorp/packer/provisioner/puppet-server   0.031s
ok      github.com/hashicorp/packer/provisioner/salt-masterless 0.010s
ok      github.com/hashicorp/packer/provisioner/shell   0.010s
ok      github.com/hashicorp/packer/provisioner/shell-local     0.037s
ok      github.com/hashicorp/packer/provisioner/windows-restart 0.180s
ok      github.com/hashicorp/packer/provisioner/windows-shell   0.159s
?       github.com/hashicorp/packer/scripts     [no test files]
ok      github.com/hashicorp/packer/template    0.008s
ok      github.com/hashicorp/packer/template/interpolate        0.004s
?       github.com/hashicorp/packer/version     [no test files]
```
2017-08-30 12:10:12 -07:00
Rickard von Essen 8a035ddb8a
parallels: Remove soon to be removed --vmtype flag
In the next release of Parallels Desktop for Mac Pro Ed. the prlctl createvm
command doen't support the --vmtype flag anymore.
2017-07-26 07:27:08 +02:00
Andy Goldstein c6dba6c051 Parallels: skip missing paths when looking for unnecessary files 2017-06-23 14:29:07 -04:00
Matthew Hooker ee5d13611f
update ssh client usage for new crypto/ssh version 2017-05-18 12:01:44 -07:00
Matthew Hooker 81522dced0
move packer to hashicorp 2017-04-04 13:39:01 -07:00
Matthew Hooker 4fcbf75da9
s/non existent/nonexistent/ 2017-03-29 12:38:33 -07:00
Matthew Hooker 230079f73a
spell fixes 2017-03-28 20:36:19 -07:00
huiyang b3c6ef9f6b Skip disk compaction for plain disks 2017-03-07 18:22:23 -08:00
huiyang 52d4514d6a builder/parallels-iso: Configuration of disk type, plain or expanding 2017-03-03 15:32:51 -08:00
Matthew Hooker 22d1322bd9
always check for an error first when walking a path 2017-01-26 16:32:21 -08:00
Matthew Hooker f1175c1921
parallels/vmware: don't wait for shutdown command.
Resolves #4134

replaces/ closes #4379

Leaving Hyper-V builder alone for now until we can get a case that reproduces.
2017-01-20 01:44:18 -08:00
Matthew Hooker d2e59e4e92
set PACKER_HTTP_ADDR env var when available.
If using a builder that has an http server set up for file transfer,
expose the connection info to the shell provisioner through the environment
variable PACKER_HTTP_ADDR.

Closes #2869
2017-01-16 23:19:52 -08:00
Rickard von Essen 85cf00069f Merge pull request #4294 from legal90/iso-target-extension
Add "iso_target_extension" option for all local *-iso builders
2017-01-04 13:48:28 +01: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
Mikhail Zholobov aa623e22a3
golint: Add comments for exported methods 2016-12-17 00:37:04 +02:00
Mikhail Zholobov 73d87b07de
golint: Fix lint offences 2016-12-17 00:37:03 +02:00
Mikhail Zholobov 00a90e622b
Remove unused constant "KeyLeftShift" 2016-12-17 00:37:03 +02:00
Mikhail Zholobov 1ca841b499
Fix shadowed declarations
Performed by "go vet" tool
2016-12-17 00:37:03 +02:00
Mikhail Zholobov dde445bd0d
Fix style: Organize imports in groups
Performed by "goimports" tool
Style conventions: https://github.com/golang/go/wiki/CodeReviewComments#imports
2016-12-17 00:37:03 +02:00
Mikhail Zholobov 319b85cb7a
Fix style: Use a consistent case for initialisms
https://github.com/golang/go/wiki/CodeReviewComments#initialisms
2016-12-17 00:36:56 +02:00
Rickard von Essen 96e9a8e6e9 Removed default value for ssh_username 2016-11-17 22:30:34 +01:00
Matthew Hooker d920b3fbf4 run gofmt 2016-11-01 14:08:04 -07:00
Rickard von Essen 3c8dabba9e Fixed formatting 2016-10-11 23:43:50 +02:00
Rickard von Essen 5e96709ee9 Merge pull request #2919 from arizvisa/floppy-recurse
Added an option for copying entire subdirectories via floppy_dirs (supplants floppy_files)
2016-10-08 16:51:16 +02:00
Ali Rizvi-Santiago 86c00490e9 Renamed any and all instances of the word "FloppyContents" to "FloppyDirectories".
Ensure that all builders include FloppyDirectories in the StepCreateFloppy options.
Changed the way the unit-tests in common/step_create_floppy_test work to use the static test-fixtures directory instead of creating the paths dynamically.
Removed a duplicate line of documentation from parallels-pvm.html.md that occurred during rebasing.
2016-09-27 23:31:42 -05:00
Rickard von Essen 06e3539ffa Merge pull request #3767 from taliesins/ExtendScanCodes
Add support for ctrl, shift and alt keys and using them as key modifier.
2016-09-20 21:36:46 +02:00
Orivej Desh 6762965696 Add -on-error command line argument to allow preserving artifacts on builder errors
Resolves #409
2016-09-16 12:15:00 +00:00
Taliesin Sisson a87ad05866 Add support for ctrl, shift and alt keys.
Add support for using ctrl, shift and alt as key modifiers. So you can now achieve ctrl+c by using "<leftCtrlOn>c<leftCtrlOff>".

Updated documentation for new key stroke tokens.
2016-07-31 19:05:10 +01:00
Ricard Clau acededfc6e tests actually test the floppies 2016-07-27 21:59:21 +01:00
Rickard von Essen fb00d07d20 Support future versions of Parallels by using the latest driver
If the Parallels Desktop for Mac version is higher than the latest
Packer driver use the latest available driver. Before this Packer needed
to be updated with every new version of PD even if there was no change
to the driver.
2016-07-02 22:18:54 +02:00
Sean Chittenden ef42021f8f Fix unit tests, broken in #3549. (#3548) 2016-05-17 15:42:15 -07:00
Sean Chittenden d0fd698fb5
Pause between boot_commands when debugging a Parallels build
When debugging a build (or maintaining an existing packer file), teach `packer build -debug` how to step through individual `boot_command`s in order to triage the packer template.
2016-05-17 17:10:10 -04:00
Rickard von Essen 46f74d8347 Parallels: Support relative paths in output_directory
Fixes #3238
2016-02-21 16:52:51 +01:00
James Bishopp bd8fb014c4 Removed ssh_key_path
- removed backwards compatibility code
- ensured key usage came from SSHPrivateKey configuration
- changed tests to use private_key
2016-02-12 17:24:42 -08:00
Rickard von Essen fd6282529c Remove deprecated parallels_tools_host_path and guest_os_distribution 2016-02-01 12:25:01 +01:00
Mark Peek 7f149e595d Refactor http server config into common 2015-11-01 14:45:47 -08: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
Mark Peek e9657e6a9f Merge pull request #2642 from oliviertremblay/master
Make TargetPath customizable
2015-10-20 12:11:13 -07:00
Rickard von Essen 4015c1789b Fixes #2836 - Use "/Applications/Parallels Desktop.app" as fallback app path. 2015-10-16 19:57:39 +02:00
Rickard von Essen 141dcd5c03 Fixes #2828: parallels prlctl_post don't interpolate values. 2015-10-15 09:28:29 +02:00
Chris Bednarski f01956405b Merge pull request #2654 from mitchellh/b-xmlpath
Update dependency to an SSL-enabled path; this was migrated from launchpad to github
2015-10-12 16:39:35 -07:00
Rickard von Essen 3f14b9d984 Merge pull request #2731 from legal90/prl-compact-disk
Parallels: Add "CompactDisk" build step
2015-09-16 14:03:31 +02:00
Mikhail Zholobov abfe706fc6 builder/parallels: Add "StepCompactDisk" 2015-09-11 11:38:20 +03:00
Mikhail Zholobov f7b26e44fe builder/parallels: Add "CompactDisk" driver function
This function compacts the specified virtual disk image.
2015-09-11 11:37:52 +03:00
Mikhail Zholobov 4ebee7bf3f builder/parallels: Add "DiskPath" driver function
This function determines path to the first virtual disk image of the specified virtual machine.
2015-09-05 13:08:24 +03:00
Rickard von Essen 83980d2326 Enable headless mode by default on Parallels Desktop 11 2015-08-24 15:09:29 +02:00
Rickard von Essen 7d3afc882a Add check for Parallels Desktop edition in PD 11.
Starting since Parallels Desktop 11, the command line functionality is
available only in Pro and Business editions.
2015-08-22 13:15:59 +02:00
Chris Bednarski 0a79546cf9 Update dependency to an SSL-enabled path; this was migrated from launchpad to github 2015-08-21 17:17:56 -07:00