From 7d658149ea392f9d5787fe367944d03ccb27c5b9 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Thu, 12 Nov 2020 14:44:02 -0800 Subject: [PATCH] update tests and website and generated partials to reflect new package format --- .github/CONTRIBUTING.md | 2 +- Makefile | 4 +-- builder/alicloud/ecs/builder.go | 4 +-- builder/alicloud/ecs/run_config.go | 2 +- builder/alicloud/ecs/step_config_eip.go | 2 +- .../ecs/step_config_security_group.go | 2 +- builder/alicloud/ecs/step_config_vpc.go | 2 +- builder/alicloud/ecs/step_config_vswitch.go | 2 +- builder/alicloud/ecs/step_create_image.go | 4 +-- builder/alicloud/ecs/step_create_instance.go | 2 +- builder/amazon/chroot/builder.go | 8 ++--- builder/amazon/chroot/copy_files_test.go | 2 +- .../amazon/chroot/step_attach_volume_test.go | 2 +- builder/amazon/chroot/step_early_unflock.go | 2 +- builder/amazon/chroot/step_flock_test.go | 2 +- builder/amazon/chroot/step_mount_device.go | 4 +-- .../amazon/chroot/step_mount_device_test.go | 2 +- builder/amazon/chroot/step_prepare_device.go | 2 +- builder/amazon/chroot/step_register_ami.go | 2 +- .../amazon/chroot/step_register_ami_test.go | 2 +- builder/amazon/common/helper_funcs.go | 2 +- .../amazon/common/interpolate_build_info.go | 2 +- .../common/interpolate_build_info_test.go | 2 +- builder/amazon/common/run_config.go | 2 +- builder/amazon/common/ssm/session.go | 4 +-- .../amazon/common/step_create_ssm_tunnel.go | 2 +- builder/amazon/common/step_create_tags.go | 2 +- builder/amazon/common/step_get_password.go | 2 +- .../common/step_iam_instance_profile.go | 2 +- builder/amazon/common/step_key_pair.go | 2 +- .../common/step_modify_ami_attributes.go | 2 +- builder/amazon/common/step_pre_validate.go | 2 +- .../amazon/common/step_run_source_instance.go | 2 +- .../amazon/common/step_run_spot_instance.go | 4 +-- builder/amazon/common/step_security_group.go | 2 +- .../amazon/common/step_set_generated_data.go | 2 +- .../amazon/common/step_stop_ebs_instance.go | 2 +- builder/amazon/common/tags.go | 2 +- builder/amazon/ebs/builder.go | 6 ++-- builder/amazon/ebs/step_create_ami.go | 4 +-- builder/amazon/ebssurrogate/builder.go | 6 ++-- .../amazon/ebssurrogate/step_register_ami.go | 2 +- builder/amazon/ebsvolume/builder.go | 6 ++-- builder/amazon/instance/builder.go | 6 ++-- builder/amazon/instance/step_register_ami.go | 2 +- .../azure/arm/azure_error_response_test.go | 2 +- builder/azure/arm/builder.go | 2 +- builder/azure/arm/config.go | 4 +-- builder/azure/arm/step_deploy_template.go | 2 +- builder/azure/arm/tempname.go | 2 +- builder/azure/arm/tempname_test.go | 2 +- builder/azure/chroot/builder.go | 6 ++-- builder/azure/chroot/step_mount_device.go | 2 +- .../azure/chroot/step_mount_device_test.go | 2 +- .../azure/dtl/azure_error_response_test.go | 2 +- builder/azure/dtl/builder.go | 2 +- builder/azure/dtl/config.go | 2 +- builder/azure/dtl/template_funcs.go | 2 +- builder/azure/dtl/tempname.go | 2 +- builder/cloudstack/builder.go | 2 +- builder/cloudstack/config.go | 6 ++-- .../cloudstack/step_create_security_group.go | 2 +- builder/digitalocean/builder.go | 2 +- builder/digitalocean/config.go | 4 +-- builder/digitalocean/step_create_ssh_key.go | 2 +- builder/docker/builder.go | 4 +-- builder/docker/config.go | 2 +- builder/docker/exec.go | 2 +- builder/docker/step_set_generated_data.go | 2 +- .../docker/step_set_generated_data_test.go | 2 +- builder/file/config.go | 2 +- builder/googlecompute/builder.go | 2 +- builder/googlecompute/config.go | 4 +-- builder/googlecompute/driver_gce.go | 2 +- builder/googlecompute/step_start_tunnel.go | 4 +-- .../googlecompute/step_wait_startup_script.go | 2 +- builder/hcloud/builder.go | 2 +- builder/hcloud/config.go | 4 +-- builder/hcloud/step_create_sshkey.go | 2 +- builder/hyperone/builder.go | 2 +- builder/hyperone/config.go | 6 ++-- builder/hyperone/step_chroot_provision.go | 2 +- builder/hyperone/token_by_ssh.go | 2 +- builder/hyperv/common/config.go | 4 +-- builder/hyperv/common/output_config.go | 2 +- builder/hyperv/common/output_config_test.go | 2 +- .../common/step_create_external_switch.go | 2 +- builder/hyperv/common/step_test.go | 2 +- .../hyperv/common/step_type_boot_command.go | 2 +- builder/hyperv/iso/builder.go | 8 ++--- builder/hyperv/iso/builder_test.go | 2 +- builder/hyperv/vmcx/builder.go | 8 ++--- builder/hyperv/vmcx/builder_test.go | 2 +- builder/jdcloud/builder.go | 2 +- builder/jdcloud/common.go | 2 +- builder/linode/builder.go | 2 +- builder/linode/config.go | 2 +- builder/lxc/builder.go | 2 +- builder/lxc/config.go | 2 +- builder/lxc/step_provision.go | 2 +- builder/lxd/builder.go | 2 +- builder/lxd/config.go | 2 +- builder/lxd/step_provision.go | 2 +- builder/ncloud/builder.go | 2 +- builder/ncloud/config.go | 2 +- builder/null/builder.go | 2 +- builder/null/config.go | 2 +- builder/oneandone/builder.go | 2 +- builder/oneandone/config.go | 2 +- builder/openstack/builder.go | 4 +-- builder/openstack/run_config.go | 2 +- builder/oracle/classic/builder.go | 2 +- builder/oracle/classic/config.go | 2 +- .../classic/step_create_ip_reservation.go | 2 +- builder/oracle/oci/builder.go | 2 +- builder/oracle/oci/config.go | 2 +- builder/osc/bsu/builder.go | 4 +-- builder/osc/bsusurrogate/builder.go | 4 +-- builder/osc/bsuvolume/builder.go | 4 +-- builder/osc/chroot/builder.go | 4 +-- builder/osc/chroot/run_local_commands.go | 2 +- builder/osc/chroot/step_chroot_provision.go | 2 +- builder/osc/common/run_config.go | 2 +- builder/osc/common/step_security_group.go | 2 +- builder/parallels/common/output_config.go | 2 +- .../parallels/common/output_config_test.go | 2 +- .../common/step_type_boot_command.go | 2 +- builder/parallels/iso/builder.go | 8 ++--- builder/parallels/iso/builder_test.go | 2 +- builder/parallels/pvm/builder.go | 2 +- builder/parallels/pvm/config.go | 8 ++--- builder/parallels/pvm/config_test.go | 2 +- builder/profitbricks/builder.go | 2 +- builder/profitbricks/config.go | 2 +- builder/proxmox/clone/step_ssh_key_pair.go | 2 +- builder/proxmox/common/bootcommand_driver.go | 2 +- builder/proxmox/common/builder.go | 2 +- builder/proxmox/common/config.go | 8 ++--- .../proxmox/common/step_type_boot_command.go | 2 +- .../common/step_type_boot_command_test.go | 2 +- builder/proxmox/iso/builder.go | 2 +- builder/proxmox/iso/config.go | 2 +- builder/proxmox/iso/step_upload_iso_test.go | 2 +- builder/qemu/builder.go | 2 +- builder/qemu/config.go | 8 ++--- builder/qemu/config_test.go | 2 +- builder/qemu/step_configure_vnc.go | 2 +- builder/qemu/step_convert_disk.go | 2 +- builder/qemu/step_port_forward.go | 2 +- builder/qemu/step_run_test.go | 2 +- builder/qemu/step_set_iso.go | 2 +- builder/qemu/step_type_boot_command.go | 2 +- builder/scaleway/builder.go | 2 +- builder/scaleway/config.go | 4 +-- builder/tencentcloud/cvm/builder.go | 4 +-- builder/tencentcloud/cvm/common.go | 2 +- builder/tencentcloud/cvm/run_config.go | 2 +- builder/triton/builder.go | 2 +- builder/triton/config.go | 2 +- builder/ucloud/common/run_config.go | 2 +- builder/ucloud/uhost/builder.go | 4 +-- builder/ucloud/uhost/step_copy_image.go | 2 +- builder/ucloud/uhost/step_create_image.go | 2 +- builder/ucloud/uhost/step_create_instance.go | 2 +- builder/ucloud/uhost/step_stop_instance.go | 2 +- builder/vagrant/builder.go | 6 ++-- builder/virtualbox/common/driver_4_2.go | 2 +- builder/virtualbox/common/output_config.go | 2 +- .../virtualbox/common/output_config_test.go | 2 +- .../virtualbox/common/step_configure_vrdp.go | 2 +- .../common/step_download_guest_additions.go | 2 +- .../virtualbox/common/step_port_forwarding.go | 2 +- .../virtualbox/common/step_remove_devices.go | 2 +- .../virtualbox/common/step_ssh_key_pair.go | 2 +- .../common/step_type_boot_command.go | 2 +- builder/virtualbox/iso/builder.go | 6 ++-- builder/virtualbox/iso/builder_test.go | 2 +- builder/virtualbox/ovf/builder.go | 2 +- builder/virtualbox/ovf/config.go | 6 ++-- builder/virtualbox/ovf/config_test.go | 2 +- builder/virtualbox/vm/builder.go | 2 +- builder/virtualbox/vm/config.go | 6 ++-- builder/vmware/common/output_config.go | 2 +- builder/vmware/common/output_config_test.go | 2 +- builder/vmware/common/run_config_test.go | 2 +- builder/vmware/common/step_configure_vnc.go | 2 +- .../vmware/common/step_vnc_boot_command.go | 2 +- builder/vmware/iso/builder.go | 2 +- builder/vmware/iso/builder_test.go | 2 +- builder/vmware/iso/config.go | 8 ++--- builder/vmware/vmx/builder.go | 2 +- builder/vmware/vmx/builder_test.go | 2 +- builder/vmware/vmx/config.go | 8 ++--- builder/vsphere/clone/builder.go | 2 +- builder/vsphere/clone/config.go | 4 +-- builder/vsphere/common/output_config.go | 2 +- builder/vsphere/common/step_boot_command.go | 2 +- builder/vsphere/common/step_export.go | 2 +- builder/vsphere/common/step_ssh_key_pair.go | 2 +- builder/vsphere/iso/builder.go | 2 +- builder/vsphere/iso/config.go | 4 +-- builder/yandex/builder.go | 4 +-- builder/yandex/config.go | 4 +-- builder/yandex/step_create_image.go | 2 +- builder/yandex/step_create_instance.go | 4 +-- builder/yandex/step_wait_cloudinit_script.go | 2 +- hcl2template/function/Consul.go | 2 +- hcl2template/function/aws_secretetkey.go | 2 +- hcl2template/function/vault.go | 2 +- helper/ssh/key_pair_test.go | 2 +- main.go | 2 +- .../adapter/adapter.go | 0 .../adapter/adapter_test.go | 0 {common => packer-plugin-sdk}/adapter/doc.go | 0 {common => packer-plugin-sdk}/adapter/scp.go | 0 .../bootcommand/boot_command.go | 0 .../bootcommand/boot_command.pigeon | 0 .../bootcommand/boot_command_ast.go | 0 .../bootcommand/boot_command_ast_test.go | 0 .../bootcommand/config.go | 0 .../bootcommand/config_test.go | 0 .../bootcommand/doc.go | 0 .../bootcommand/driver.go | 0 .../bootcommand/gen.go | 0 .../bootcommand/pc_xt_driver.go | 0 .../bootcommand/pc_xt_driver_test.go | 0 .../bootcommand/usb_driver.go | 0 .../bootcommand/usb_driver_test.go | 0 .../bootcommand/vnc_driver.go | 0 .../bootcommand/vnc_driver_test.go | 0 .../chroot/cleanup.go | 0 .../chroot/communicator.go | 2 +- .../chroot/communicator_test.go | 0 {common => packer-plugin-sdk}/chroot/doc.go | 0 .../chroot/interpolate_context_provider.go | 0 .../chroot/run_local_commands.go | 4 +-- .../chroot/step_chroot_provision.go | 4 +-- .../chroot/step_copy_files.go | 2 +- .../chroot/step_copy_files_test.go | 2 +- .../chroot/step_early_cleanup.go | 0 .../chroot/step_mount_extra.go | 2 +- .../chroot/step_mount_extra_test.go | 0 .../chroot/step_post_mount_commands.go | 2 +- .../chroot/step_pre_mount_commands.go | 2 +- .../common}/command.go | 0 .../common}/packer_config.go | 0 .../commonsteps/doc.go | 0 .../commonsteps/extra_iso_config.go | 0 .../commonsteps/extra_iso_config_test.go | 0 .../commonsteps/floppy_config.go | 0 .../commonsteps/floppy_config_test.go | 0 .../commonsteps/http_config.go | 0 .../commonsteps/http_config_test.go | 0 .../commonsteps/iso_config.go | 0 .../commonsteps/iso_config_test.go | 0 .../commonsteps/multistep_debug.go | 0 .../commonsteps/multistep_runner.go | 2 +- .../commonsteps/step_cleanup_temp_keys.go | 0 .../commonsteps/step_create_cdrom.go | 2 +- .../commonsteps/step_create_cdrom_test.go | 0 .../commonsteps/step_create_floppy.go | 0 .../commonsteps/step_create_floppy_test.go | 0 .../commonsteps/step_download.go | 2 +- .../commonsteps/step_download_test.go | 0 .../commonsteps/step_http_server.go | 2 +- .../commonsteps/step_output_dir.go | 0 .../commonsteps/step_output_dir_test.go | 0 .../commonsteps/step_provision.go | 0 .../commonsteps/step_provision_test.go | 0 .../test-fixtures/SomeDir/myfile.txt | 0 .../test-fixtures/floppy-hier/test-0/file1 | 0 .../test-fixtures/floppy-hier/test-0/file2 | 0 .../test-fixtures/floppy-hier/test-0/file3 | 0 .../floppy-hier/test-1/dir1/file1 | 0 .../floppy-hier/test-1/dir1/file2 | 0 .../floppy-hier/test-1/dir1/file3 | 0 .../floppy-hier/test-2/dir1/file1 | 0 .../floppy-hier/test-2/dir1/subdir1/file1 | 0 .../floppy-hier/test-2/dir1/subdir1/file2 | 0 .../floppy-hier/test-2/dir2/subdir1/file1 | 0 .../floppy-hier/test-2/dir2/subdir1/file2 | 0 .../test-fixtures/root/another.txt | 0 .../test-fixtures/root/another.txt.sha1sum | 0 .../commonsteps/test-fixtures/root/basic.txt | 0 .../test-fixtures/root/basic.txt.sha1sum | 0 .../test-fixtures/root/subfolder.sum | 0 {common => packer-plugin-sdk}/filelock/doc.go | 0 .../filelock/filelock.go | 0 .../filelock/filelock_solaris.go | 0 .../filelock/noop.go | 0 .../guestexec/doc.go | 0 .../guestexec/elevated.go | 2 +- .../guestexec/elevated_test.go | 0 .../guestexec/guest_commands.go | 0 .../guestexec/guest_commands_test.go | 0 .../iochan/iochan.go | 0 .../iochan/iochan_test.go | 0 .../json/unmarshal.go | 0 .../json/unmarshal_test.go | 0 .../net/configure_port.go | 4 +-- .../net/configure_port_test.go | 0 .../net/default_client.go | 0 .../packerbuilderdata/generated_data.go | 0 .../packerbuilderdata/generated_data_test.go | 0 .../random/string.go | 0 {common => packer-plugin-sdk}/retry/retry.go | 0 .../retry/retry_test.go | 0 .../retry/utils_test.go | 0 .../shell-local/communicator.go | 0 .../shell-local/communicator_test.go | 0 .../shell-local/config.go | 2 +- .../shell-local/config.hcl2spec.go | 0 .../shell-local/config_test.go | 0 .../shell-local/doc.go | 0 .../shell-local/localexec/run_and_stream.go | 2 +- .../localexec/run_and_stream_test.go | 0 .../shell-local/run.go | 2 +- .../shell/exit_code.go | 0 .../shell/exit_code_test.go | 0 {common => packer-plugin-sdk}/shell/shell.go | 2 +- .../shutdowncommand/config.go | 0 .../shutdowncommand/config_test.go | 0 .../template/funcs.go | 0 .../template/interpolate/funcs.go | 6 ++-- .../template/interpolate/funcs_test.go | 2 +- .../test-fixtures/SomeDir/myfile.txt | 0 .../decompress-tar/outside_parent.tar | Bin .../test-fixtures/floppies/bar.bat | 0 .../test-fixtures/floppies/foo.ps1 | 0 .../test-fixtures/floppy-hier/test-0/file1 | 0 .../test-fixtures/floppy-hier/test-0/file2 | 0 .../test-fixtures/floppy-hier/test-0/file3 | 0 .../floppy-hier/test-1/dir1/file1 | 0 .../floppy-hier/test-1/dir1/file2 | 0 .../floppy-hier/test-1/dir1/file3 | 0 .../floppy-hier/test-2/dir1/file1 | 0 .../floppy-hier/test-2/dir1/subdir1/file1 | 0 .../floppy-hier/test-2/dir1/subdir1/file2 | 0 .../floppy-hier/test-2/dir2/subdir1/file1 | 0 .../floppy-hier/test-2/dir2/subdir1/file2 | 0 {common => packer-plugin-sdk}/uuid/uuid.go | 0 .../uuid/uuid_test.go | 0 packer/build.go | 2 +- packer/build_test.go | 2 +- packer/communicator_test.go | 2 +- packer/provisioner.go | 2 +- packer/rpc/ui_progress_tracking.go | 2 +- .../amazon-import/post-processor.go | 4 +-- post-processor/artifice/post-processor.go | 2 +- post-processor/checksum/post-processor.go | 2 +- post-processor/compress/post-processor.go | 2 +- .../digitalocean-import/post-processor.go | 2 +- .../docker-import/post-processor.go | 2 +- post-processor/docker-push/post-processor.go | 2 +- post-processor/docker-save/post-processor.go | 2 +- post-processor/docker-tag/post-processor.go | 2 +- .../exoscale-import/post-processor.go | 2 +- .../googlecompute-export/post-processor.go | 4 +-- .../googlecompute-import/post-processor.go | 2 +- post-processor/manifest/post-processor.go | 2 +- post-processor/shell-local/post-processor.go | 2 +- .../ucloud-import/post-processor.go | 4 +-- post-processor/vagrant-cloud/client.go | 2 +- .../vagrant-cloud/post-processor.go | 4 +-- post-processor/vagrant-cloud/step_upload.go | 2 +- post-processor/vagrant/post-processor.go | 2 +- post-processor/vagrant/virtualbox_test.go | 2 +- .../vsphere-template/post-processor.go | 4 +-- post-processor/vsphere/post-processor.go | 4 +-- .../yandex-export/post-processor.go | 6 ++-- .../yandex-import/post-processor.go | 2 +- provisioner/ansible-local/provisioner.go | 4 +-- provisioner/ansible/provisioner.go | 6 ++-- provisioner/ansible/provisioner_test.go | 2 +- provisioner/azure-dtlartifact/provisioner.go | 2 +- provisioner/breakpoint/provisioner.go | 2 +- provisioner/chef-client/provisioner.go | 6 ++-- provisioner/chef-solo/provisioner.go | 4 +-- provisioner/converge/provisioner.go | 2 +- provisioner/file/provisioner.go | 2 +- provisioner/inspec/provisioner.go | 4 +-- provisioner/powershell/provisioner.go | 10 +++---- provisioner/powershell/provisioner_test.go | 2 +- provisioner/puppet-masterless/provisioner.go | 4 +-- provisioner/puppet-server/provisioner.go | 4 +-- provisioner/salt-masterless/provisioner.go | 4 +-- provisioner/shell-local/provisioner.go | 2 +- provisioner/shell/provisioner.go | 6 ++-- provisioner/shell/provisioner_test.go | 2 +- provisioner/windows-restart/provisioner.go | 4 +-- provisioner/windows-shell/provisioner.go | 6 ++-- provisioner/windows-shell/provisioner_test.go | 2 +- website/pages/docs/builders/cloudstack.mdx | 4 +-- website/pages/docs/builders/hyperv/iso.mdx | 22 +++++++------- website/pages/docs/builders/hyperv/vmcx.mdx | 14 ++++----- website/pages/docs/builders/parallels/iso.mdx | 6 ++-- website/pages/docs/builders/proxmox/iso.mdx | 4 +-- website/pages/docs/builders/qemu.mdx | 28 +++++++++--------- .../pages/docs/builders/virtualbox/iso.mdx | 22 +++++++------- .../pages/docs/builders/virtualbox/ovf.mdx | 16 +++++----- website/pages/docs/builders/virtualbox/vm.mdx | 16 +++++----- website/pages/docs/builders/vmware/iso.mdx | 26 ++++++++-------- website/pages/docs/builders/vmware/vmx.mdx | 22 +++++++------- .../docs/builders/vmware/vsphere-clone.mdx | 12 ++++---- .../docs/builders/vmware/vsphere-iso.mdx | 18 +++++------ .../bootcommand/BootConfig-not-required.mdx | 2 +- .../bootcommand/BootConfig.mdx | 2 +- .../bootcommand/VNCConfig-not-required.mdx | 2 +- .../bootcommand/VNCConfig.mdx | 2 +- .../commonsteps/CDConfig-not-required.mdx | 2 +- .../commonsteps/CDConfig.mdx | 2 +- .../commonsteps/FloppyConfig-not-required.mdx | 2 +- .../commonsteps/FloppyConfig.mdx | 2 +- .../commonsteps/HTTPConfig-not-required.mdx | 2 +- .../commonsteps/HTTPConfig.mdx | 2 +- .../commonsteps/ISOConfig-not-required.mdx | 2 +- .../commonsteps/ISOConfig-required.mdx | 2 +- .../commonsteps/ISOConfig.mdx | 2 +- .../ShutdownConfig-not-required.mdx | 2 +- .../shutdowncommand/ShutdownConfig.mdx | 9 ++++++ 420 files changed, 517 insertions(+), 508 deletions(-) rename {common => packer-plugin-sdk}/adapter/adapter.go (100%) rename {common => packer-plugin-sdk}/adapter/adapter_test.go (100%) rename {common => packer-plugin-sdk}/adapter/doc.go (100%) rename {common => packer-plugin-sdk}/adapter/scp.go (100%) rename {common => packer-plugin-sdk}/bootcommand/boot_command.go (100%) rename {common => packer-plugin-sdk}/bootcommand/boot_command.pigeon (100%) rename {common => packer-plugin-sdk}/bootcommand/boot_command_ast.go (100%) rename {common => packer-plugin-sdk}/bootcommand/boot_command_ast_test.go (100%) rename {common => packer-plugin-sdk}/bootcommand/config.go (100%) rename {common => packer-plugin-sdk}/bootcommand/config_test.go (100%) rename {common => packer-plugin-sdk}/bootcommand/doc.go (100%) rename {common => packer-plugin-sdk}/bootcommand/driver.go (100%) rename {common => packer-plugin-sdk}/bootcommand/gen.go (100%) rename {common => packer-plugin-sdk}/bootcommand/pc_xt_driver.go (100%) rename {common => packer-plugin-sdk}/bootcommand/pc_xt_driver_test.go (100%) rename {common => packer-plugin-sdk}/bootcommand/usb_driver.go (100%) rename {common => packer-plugin-sdk}/bootcommand/usb_driver_test.go (100%) rename {common => packer-plugin-sdk}/bootcommand/vnc_driver.go (100%) rename {common => packer-plugin-sdk}/bootcommand/vnc_driver_test.go (100%) rename {common => packer-plugin-sdk}/chroot/cleanup.go (100%) rename {common => packer-plugin-sdk}/chroot/communicator.go (98%) rename {common => packer-plugin-sdk}/chroot/communicator_test.go (100%) rename {common => packer-plugin-sdk}/chroot/doc.go (100%) rename {common => packer-plugin-sdk}/chroot/interpolate_context_provider.go (100%) rename {common => packer-plugin-sdk}/chroot/run_local_commands.go (89%) rename {common => packer-plugin-sdk}/chroot/step_chroot_provision.go (91%) rename {common => packer-plugin-sdk}/chroot/step_copy_files.go (97%) rename {common => packer-plugin-sdk}/chroot/step_copy_files_test.go (98%) rename {common => packer-plugin-sdk}/chroot/step_early_cleanup.go (100%) rename {common => packer-plugin-sdk}/chroot/step_mount_extra.go (98%) rename {common => packer-plugin-sdk}/chroot/step_mount_extra_test.go (100%) rename {common => packer-plugin-sdk}/chroot/step_post_mount_commands.go (95%) rename {common => packer-plugin-sdk}/chroot/step_pre_mount_commands.go (95%) rename {common => packer-plugin-sdk/common}/command.go (100%) rename {common => packer-plugin-sdk/common}/packer_config.go (100%) rename {common => packer-plugin-sdk}/commonsteps/doc.go (100%) rename {common => packer-plugin-sdk}/commonsteps/extra_iso_config.go (100%) rename {common => packer-plugin-sdk}/commonsteps/extra_iso_config_test.go (100%) rename {common => packer-plugin-sdk}/commonsteps/floppy_config.go (100%) rename {common => packer-plugin-sdk}/commonsteps/floppy_config_test.go (100%) rename {common => packer-plugin-sdk}/commonsteps/http_config.go (100%) rename {common => packer-plugin-sdk}/commonsteps/http_config_test.go (100%) rename {common => packer-plugin-sdk}/commonsteps/iso_config.go (100%) rename {common => packer-plugin-sdk}/commonsteps/iso_config_test.go (100%) rename {common => packer-plugin-sdk}/commonsteps/multistep_debug.go (100%) rename {common => packer-plugin-sdk}/commonsteps/multistep_runner.go (98%) rename {common => packer-plugin-sdk}/commonsteps/step_cleanup_temp_keys.go (100%) rename {common => packer-plugin-sdk}/commonsteps/step_create_cdrom.go (99%) rename {common => packer-plugin-sdk}/commonsteps/step_create_cdrom_test.go (100%) rename {common => packer-plugin-sdk}/commonsteps/step_create_floppy.go (100%) rename {common => packer-plugin-sdk}/commonsteps/step_create_floppy_test.go (100%) rename {common => packer-plugin-sdk}/commonsteps/step_download.go (99%) rename {common => packer-plugin-sdk}/commonsteps/step_download_test.go (100%) rename {common => packer-plugin-sdk}/commonsteps/step_http_server.go (96%) rename {common => packer-plugin-sdk}/commonsteps/step_output_dir.go (100%) rename {common => packer-plugin-sdk}/commonsteps/step_output_dir_test.go (100%) rename {common => packer-plugin-sdk}/commonsteps/step_provision.go (100%) rename {common => packer-plugin-sdk}/commonsteps/step_provision_test.go (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/SomeDir/myfile.txt (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/floppy-hier/test-0/file1 (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/floppy-hier/test-0/file2 (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/floppy-hier/test-0/file3 (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/floppy-hier/test-1/dir1/file1 (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/floppy-hier/test-1/dir1/file2 (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/floppy-hier/test-1/dir1/file3 (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/floppy-hier/test-2/dir1/file1 (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/floppy-hier/test-2/dir1/subdir1/file1 (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/floppy-hier/test-2/dir1/subdir1/file2 (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/floppy-hier/test-2/dir2/subdir1/file1 (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/floppy-hier/test-2/dir2/subdir1/file2 (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/root/another.txt (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/root/another.txt.sha1sum (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/root/basic.txt (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/root/basic.txt.sha1sum (100%) rename {common => packer-plugin-sdk}/commonsteps/test-fixtures/root/subfolder.sum (100%) rename {common => packer-plugin-sdk}/filelock/doc.go (100%) rename {common => packer-plugin-sdk}/filelock/filelock.go (100%) rename {common => packer-plugin-sdk}/filelock/filelock_solaris.go (100%) rename {common => packer-plugin-sdk}/filelock/noop.go (100%) rename {common => packer-plugin-sdk}/guestexec/doc.go (100%) rename {common => packer-plugin-sdk}/guestexec/elevated.go (99%) rename {common => packer-plugin-sdk}/guestexec/elevated_test.go (100%) rename {common => packer-plugin-sdk}/guestexec/guest_commands.go (100%) rename {common => packer-plugin-sdk}/guestexec/guest_commands_test.go (100%) rename {common => packer-plugin-sdk}/iochan/iochan.go (100%) rename {common => packer-plugin-sdk}/iochan/iochan_test.go (100%) rename {common => packer-plugin-sdk}/json/unmarshal.go (100%) rename {common => packer-plugin-sdk}/json/unmarshal_test.go (100%) rename {common => packer-plugin-sdk}/net/configure_port.go (96%) rename {common => packer-plugin-sdk}/net/configure_port_test.go (100%) rename {common => packer-plugin-sdk}/net/default_client.go (100%) rename {common => packer-plugin-sdk}/packerbuilderdata/generated_data.go (100%) rename {common => packer-plugin-sdk}/packerbuilderdata/generated_data_test.go (100%) rename {common => packer-plugin-sdk}/random/string.go (100%) rename {common => packer-plugin-sdk}/retry/retry.go (100%) rename {common => packer-plugin-sdk}/retry/retry_test.go (100%) rename {common => packer-plugin-sdk}/retry/utils_test.go (100%) rename {common => packer-plugin-sdk}/shell-local/communicator.go (100%) rename {common => packer-plugin-sdk}/shell-local/communicator_test.go (100%) rename {common => packer-plugin-sdk}/shell-local/config.go (99%) rename {common => packer-plugin-sdk}/shell-local/config.hcl2spec.go (100%) rename {common => packer-plugin-sdk}/shell-local/config_test.go (100%) rename {common => packer-plugin-sdk}/shell-local/doc.go (100%) rename {common => packer-plugin-sdk}/shell-local/localexec/run_and_stream.go (97%) rename {common => packer-plugin-sdk}/shell-local/localexec/run_and_stream_test.go (100%) rename {common => packer-plugin-sdk}/shell-local/run.go (99%) rename {common => packer-plugin-sdk}/shell/exit_code.go (100%) rename {common => packer-plugin-sdk}/shell/exit_code_test.go (100%) rename {common => packer-plugin-sdk}/shell/shell.go (97%) rename {common => packer-plugin-sdk}/shutdowncommand/config.go (100%) rename {common => packer-plugin-sdk}/shutdowncommand/config_test.go (100%) rename {common => packer-plugin-sdk}/template/funcs.go (100%) create mode 100644 packer-plugin-sdk/test-fixtures/SomeDir/myfile.txt rename {common => packer-plugin-sdk}/test-fixtures/decompress-tar/outside_parent.tar (100%) rename {common => packer-plugin-sdk}/test-fixtures/floppies/bar.bat (100%) rename {common => packer-plugin-sdk}/test-fixtures/floppies/foo.ps1 (100%) create mode 100644 packer-plugin-sdk/test-fixtures/floppy-hier/test-0/file1 create mode 100644 packer-plugin-sdk/test-fixtures/floppy-hier/test-0/file2 create mode 100644 packer-plugin-sdk/test-fixtures/floppy-hier/test-0/file3 create mode 100644 packer-plugin-sdk/test-fixtures/floppy-hier/test-1/dir1/file1 create mode 100644 packer-plugin-sdk/test-fixtures/floppy-hier/test-1/dir1/file2 create mode 100644 packer-plugin-sdk/test-fixtures/floppy-hier/test-1/dir1/file3 create mode 100644 packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir1/file1 create mode 100644 packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir1/subdir1/file1 create mode 100644 packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir1/subdir1/file2 create mode 100644 packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir2/subdir1/file1 create mode 100644 packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir2/subdir1/file2 rename {common => packer-plugin-sdk}/uuid/uuid.go (100%) rename {common => packer-plugin-sdk}/uuid/uuid_test.go (100%) rename website/pages/partials/{common => packer-plugin-sdk}/bootcommand/BootConfig-not-required.mdx (94%) rename website/pages/partials/{common => packer-plugin-sdk}/bootcommand/BootConfig.mdx (98%) rename website/pages/partials/{common => packer-plugin-sdk}/bootcommand/VNCConfig-not-required.mdx (81%) rename website/pages/partials/{common => packer-plugin-sdk}/bootcommand/VNCConfig.mdx (87%) rename website/pages/partials/{common => packer-plugin-sdk}/commonsteps/CDConfig-not-required.mdx (95%) rename website/pages/partials/{common => packer-plugin-sdk}/commonsteps/CDConfig.mdx (86%) rename website/pages/partials/{common => packer-plugin-sdk}/commonsteps/FloppyConfig-not-required.mdx (92%) rename website/pages/partials/{common => packer-plugin-sdk}/commonsteps/FloppyConfig.mdx (88%) rename website/pages/partials/{common => packer-plugin-sdk}/commonsteps/HTTPConfig-not-required.mdx (93%) rename website/pages/partials/{common => packer-plugin-sdk}/commonsteps/HTTPConfig.mdx (83%) rename website/pages/partials/{common => packer-plugin-sdk}/commonsteps/ISOConfig-not-required.mdx (91%) rename website/pages/partials/{common => packer-plugin-sdk}/commonsteps/ISOConfig-required.mdx (94%) rename website/pages/partials/{common => packer-plugin-sdk}/commonsteps/ISOConfig.mdx (95%) rename website/pages/partials/{common => packer-plugin-sdk}/shutdowncommand/ShutdownConfig-not-required.mdx (92%) create mode 100644 website/pages/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig.mdx diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 71f86e553..7acea7daf 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -259,7 +259,7 @@ does not attempt to track the latest version for each dependency. #### Code generation Packer relies on `go generate` to generate a [peg parser for boot -commands](https://github.com/hashicorp/packer/blob/master/common/bootcommand/boot_command.go), +commands](https://github.com/hashicorp/packer/blob/master/packer-plugin-sdk/bootcommand/boot_command.go), [docs](https://github.com/hashicorp/packer/blob/master/website/pages/partials/builder/amazon/chroot/_Config-not-required.mdx) and HCL2's bridging code. Packer's testing suite will run `make check-generate` to check that all the generated files Packer needs are what they should be. diff --git a/Makefile b/Makefile index 589dde035..f4d375843 100644 --- a/Makefile +++ b/Makefile @@ -123,9 +123,9 @@ generate: install-gen-deps ## Generate dynamically generated code @echo "==> removing autogenerated markdown..." @find website/pages/ -type f | xargs grep -l '^ + - `boot_keygroup_interval` (duration string | ex: "1h5m2s") - Time to wait after sending a group of key pressses. The value of this should be a duration. Examples are `5s` and `1m30s` which will cause diff --git a/website/pages/partials/common/bootcommand/BootConfig.mdx b/website/pages/partials/packer-plugin-sdk/bootcommand/BootConfig.mdx similarity index 98% rename from website/pages/partials/common/bootcommand/BootConfig.mdx rename to website/pages/partials/packer-plugin-sdk/bootcommand/BootConfig.mdx index f8115899c..8d41f834f 100644 --- a/website/pages/partials/common/bootcommand/BootConfig.mdx +++ b/website/pages/partials/packer-plugin-sdk/bootcommand/BootConfig.mdx @@ -1,4 +1,4 @@ - + The boot configuration is very important: `boot_command` specifies the keys to type when the virtual machine is first booted in order to start the OS diff --git a/website/pages/partials/common/bootcommand/VNCConfig-not-required.mdx b/website/pages/partials/packer-plugin-sdk/bootcommand/VNCConfig-not-required.mdx similarity index 81% rename from website/pages/partials/common/bootcommand/VNCConfig-not-required.mdx rename to website/pages/partials/packer-plugin-sdk/bootcommand/VNCConfig-not-required.mdx index 6c532fd4f..008fdb54a 100644 --- a/website/pages/partials/common/bootcommand/VNCConfig-not-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/bootcommand/VNCConfig-not-required.mdx @@ -1,4 +1,4 @@ - + - `disable_vnc` (bool) - Whether to create a VNC connection or not. A boot_command cannot be used when this is true. Defaults to false. diff --git a/website/pages/partials/common/bootcommand/VNCConfig.mdx b/website/pages/partials/packer-plugin-sdk/bootcommand/VNCConfig.mdx similarity index 87% rename from website/pages/partials/common/bootcommand/VNCConfig.mdx rename to website/pages/partials/packer-plugin-sdk/bootcommand/VNCConfig.mdx index 34a6748ac..f539a6590 100644 --- a/website/pages/partials/common/bootcommand/VNCConfig.mdx +++ b/website/pages/partials/packer-plugin-sdk/bootcommand/VNCConfig.mdx @@ -1,4 +1,4 @@ - + The boot command "typed" character for character over a VNC connection to the machine, simulating a human actually typing the keyboard. diff --git a/website/pages/partials/common/commonsteps/CDConfig-not-required.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/CDConfig-not-required.mdx similarity index 95% rename from website/pages/partials/common/commonsteps/CDConfig-not-required.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/CDConfig-not-required.mdx index 9fc2cdc23..9486e4f03 100644 --- a/website/pages/partials/common/commonsteps/CDConfig-not-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/CDConfig-not-required.mdx @@ -1,4 +1,4 @@ - + - `cd_files` ([]string) - A list of files to place onto a CD that is attached when the VM is booted. This can include either files or directories; any directories diff --git a/website/pages/partials/common/commonsteps/CDConfig.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/CDConfig.mdx similarity index 86% rename from website/pages/partials/common/commonsteps/CDConfig.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/CDConfig.mdx index a139db6a4..e861c99f0 100644 --- a/website/pages/partials/common/commonsteps/CDConfig.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/CDConfig.mdx @@ -1,4 +1,4 @@ - + An iso (CD) containing custom files can be made available for your build. diff --git a/website/pages/partials/common/commonsteps/FloppyConfig-not-required.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/FloppyConfig-not-required.mdx similarity index 92% rename from website/pages/partials/common/commonsteps/FloppyConfig-not-required.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/FloppyConfig-not-required.mdx index c81d3f61f..c261f96e2 100644 --- a/website/pages/partials/common/commonsteps/FloppyConfig-not-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/FloppyConfig-not-required.mdx @@ -1,4 +1,4 @@ - + - `floppy_files` ([]string) - A list of files to place onto a floppy disk that is attached when the VM is booted. Currently, no support exists for creating sub-directories on diff --git a/website/pages/partials/common/commonsteps/FloppyConfig.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/FloppyConfig.mdx similarity index 88% rename from website/pages/partials/common/commonsteps/FloppyConfig.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/FloppyConfig.mdx index 8db59da19..a6474cf6e 100644 --- a/website/pages/partials/common/commonsteps/FloppyConfig.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/FloppyConfig.mdx @@ -1,4 +1,4 @@ - + A floppy can be made available for your build. This is most useful for unattended Windows installs, which look for an Autounattend.xml file on diff --git a/website/pages/partials/common/commonsteps/HTTPConfig-not-required.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/HTTPConfig-not-required.mdx similarity index 93% rename from website/pages/partials/common/commonsteps/HTTPConfig-not-required.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/HTTPConfig-not-required.mdx index aece4b6de..82bf23690 100644 --- a/website/pages/partials/common/commonsteps/HTTPConfig-not-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/HTTPConfig-not-required.mdx @@ -1,4 +1,4 @@ - + - `http_directory` (string) - Path to a directory to serve using an HTTP server. The files in this directory will be available over HTTP that will be requestable from the diff --git a/website/pages/partials/common/commonsteps/HTTPConfig.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/HTTPConfig.mdx similarity index 83% rename from website/pages/partials/common/commonsteps/HTTPConfig.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/HTTPConfig.mdx index f841432a8..8fad89d65 100644 --- a/website/pages/partials/common/commonsteps/HTTPConfig.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/HTTPConfig.mdx @@ -1,4 +1,4 @@ - + Packer will create an http server serving `http_directory` when it is set, a random free port will be selected and the architecture of the directory diff --git a/website/pages/partials/common/commonsteps/ISOConfig-not-required.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig-not-required.mdx similarity index 91% rename from website/pages/partials/common/commonsteps/ISOConfig-not-required.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig-not-required.mdx index 9d0744786..60e976cbb 100644 --- a/website/pages/partials/common/commonsteps/ISOConfig-not-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig-not-required.mdx @@ -1,4 +1,4 @@ - + - `iso_urls` ([]string) - Multiple URLs for the ISO to download. Packer will try these in order. If anything goes wrong attempting to download or while downloading a diff --git a/website/pages/partials/common/commonsteps/ISOConfig-required.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig-required.mdx similarity index 94% rename from website/pages/partials/common/commonsteps/ISOConfig-required.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig-required.mdx index a2c27df83..5e6624577 100644 --- a/website/pages/partials/common/commonsteps/ISOConfig-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig-required.mdx @@ -1,4 +1,4 @@ - + - `iso_checksum` (string) - The checksum for the ISO file or virtual hard drive file. The type of the checksum is specified within the checksum field as a prefix, ex: diff --git a/website/pages/partials/common/commonsteps/ISOConfig.mdx b/website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig.mdx similarity index 95% rename from website/pages/partials/common/commonsteps/ISOConfig.mdx rename to website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig.mdx index 548bffa0b..5e55a847e 100644 --- a/website/pages/partials/common/commonsteps/ISOConfig.mdx +++ b/website/pages/partials/packer-plugin-sdk/commonsteps/ISOConfig.mdx @@ -1,4 +1,4 @@ - + By default, Packer will symlink, download or copy image files to the Packer cache into a "`hash($iso_url+$iso_checksum).$iso_target_extension`" file. diff --git a/website/pages/partials/common/shutdowncommand/ShutdownConfig-not-required.mdx b/website/pages/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig-not-required.mdx similarity index 92% rename from website/pages/partials/common/shutdowncommand/ShutdownConfig-not-required.mdx rename to website/pages/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig-not-required.mdx index 2b705dd61..0cd262f0d 100644 --- a/website/pages/partials/common/shutdowncommand/ShutdownConfig-not-required.mdx +++ b/website/pages/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig-not-required.mdx @@ -1,4 +1,4 @@ - + - `shutdown_command` (string) - The command to use to gracefully shut down the machine once all provisioning is complete. By default this is an empty string, which diff --git a/website/pages/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig.mdx b/website/pages/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig.mdx new file mode 100644 index 000000000..e958c8ca3 --- /dev/null +++ b/website/pages/partials/packer-plugin-sdk/shutdowncommand/ShutdownConfig.mdx @@ -0,0 +1,9 @@ + + +ShutdownConfig defines implementation details for shutting down a VM once it +is done provisioned. +It is provided as a convenience to encourage builder developers to +consider implementing these options, which we believe are valuable for all +builders. It also helps guarantee that option names for similar options +are the same across the various builders. Embed it in your builder config +using the `mapstructure:",squash"` struct tag.