fix generation script, bugfixes in source comments, update website paths in primary codebase

This commit is contained in:
Jeff Escalante 2020-04-01 23:30:51 -04:00
parent 9165be87da
commit 2999934326
No known key found for this signature in database
GPG Key ID: 32D23C61AB5450DB
23 changed files with 104 additions and 109 deletions

View File

@ -15,20 +15,20 @@ can quickly merge or address your contributions.
### Reporting an Issue
* Make sure you test against the latest released version. It is possible we
- Make sure you test against the latest released version. It is possible we
already fixed the bug you're experiencing.
* Run the command with debug output with the environment variable `PACKER_LOG`.
- Run the command with debug output with the environment variable `PACKER_LOG`.
For example: `PACKER_LOG=1 packer build template.json`. Take the _entire_
output and create a [gist](https://gist.github.com) for linking to in your
issue. Packer should strip sensitive keys from the output, but take a look
through just in case.
* Provide a reproducible test case. If a contributor can't reproduce an issue,
- Provide a reproducible test case. If a contributor can't reproduce an issue,
then it dramatically lowers the chances it'll get fixed. And in some cases,
the issue will eventually be closed.
* Respond promptly to any questions made by the Packer team to your issue. Stale
- Respond promptly to any questions made by the Packer team to your issue. Stale
issues will be closed.
### Issue Lifecycle
@ -86,23 +86,23 @@ The instructions below are for go 1.7. or later.
submitting a pull-request.
### Windows Systems
On windows systems you need at least the [MinGW Tools](http://www.mingw.org/), e.g. install via [choco](https://chocolatey.org/):
```
choco install mingw -y
```
This installs the GCC compiler, as well as a ```mingw32-make``` which can be used wherever
this documentation mentions ```make```
This installs the GCC compiler, as well as a `mingw32-make` which can be used wherever
this documentation mentions `make`
when building using ```go``` you also need to mention the windows
when building using `go` you also need to mention the windows
executable extension
```
go build -o bin/packer.exe
```
### Opening an Pull Request
Thank you for contributing! When you are ready to open a pull-request, you will
@ -162,7 +162,6 @@ to use `git push ...`.
6. In rare cases, we might decide that a PR should be closed without merging.
We'll make sure to provide clear reasoning when this happens.
### Tips for Working on Packer
#### Getting Your Pull Requests Merged Faster
@ -250,7 +249,7 @@ does not attempt to track the latest version for each dependency.
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),
[docs](https://github.com/hashicorp/packer/blob/master/website/source/partials/builder/amazon/chroot/_Config-not-required.html.md)
[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.
`make generate` re-generates all these file and can take a while depending on
@ -266,11 +265,13 @@ Packer relies on [golangci-lint](https://github.com/golangci/golangci-lint) for
The main configuration for golangci-lint is the `.golangci.yml` in the project root. See `golangci-lint --help` for a list of flags that can be used to override the default configuration.
Run golangci-lint on the entire Packer code base.
```
make lint
```
Run golangci-lint on a single pkg or directory; PKG_NAME expands to /builder/amazon/...
```
make lint PKG_NAME=builder/amazon
```

View File

@ -3,61 +3,61 @@
# builders
/builder/alicloud/ @chhaj5236 @alexyueer
/website/source/docs/builders/alicloud* @chhaj5236 @alexyueer
/website/pages/docs/builders/alicloud* @chhaj5236 @alexyueer
/builder/azure/ @paulmey
/website/source/docs/builders/azure* @paulmey
/website/pages/docs/builders/azure* @paulmey
/builder/hyperv/ @taliesins
/website/source/docs/builders/hyperv* @taliesins
/website/pages/docs/builders/hyperv* @taliesins
/builder/jdcloud/ @XiaohanLiang @remrain
/website/source/docs/builders/jdcloud* @XiaohanLiang @remrain
/website/pages/docs/builders/jdcloud* @XiaohanLiang @remrain
/builder/linode/ @displague @ctreatma @stvnjacobs
/website/source/docs/builders/linode* @displague @ctreatma @stvnjacobs
/website/pages/docs/builders/linode* @displague @ctreatma @stvnjacobs
/builder/lxc/ @ChrisLundquist
/website/source/docs/builders/lxc* @ChrisLundquist
/website/pages/docs/builders/lxc* @ChrisLundquist
/builder/lxd/ @ChrisLundquist
/website/source/docs/builders/lxd* @ChrisLundquist
/website/pages/docs/builders/lxd* @ChrisLundquist
/builder/oneandone/ @jasmingacic
/website/source/docs/builders/oneandone* @jasmingacic
/website/pages/docs/builders/oneandone* @jasmingacic
/builder/oracle/ @prydie @owainlewis
/website/source/docs/builders/oracle* @prydie @owainlewis
/website/pages/docs/builders/oracle* @prydie @owainlewis
/builder/profitbricks/ @jasmingacic
/website/source/docs/builders/profitbricks* @jasmingacic
/website/pages/docs/builders/profitbricks* @jasmingacic
/builder/triton/ @sean-
/website/source/docs/builders/triton* @sean-
/website/pages/docs/builders/triton* @sean-
/builder/ncloud/ @YuSungDuk
/website/source/docs/builders/ncloud* @YuSungDuk
/website/pages/docs/builders/ncloud* @YuSungDuk
/builder/proxmox/ @carlpett
/website/source/docs/builders/proxmox* @carlpett
/website/pages/docs/builders/proxmox* @carlpett
/builder/scaleway/ @sieben @mvaude @jqueuniet @fflorens @brmzkw
/website/source/docs/builders/scaleway* @sieben @mvaude @jqueuniet @fflorens @brmzkw
/website/pages/docs/builders/scaleway* @sieben @mvaude @jqueuniet @fflorens @brmzkw
/builder/hcloud/ @LKaemmerling
/website/source/docs/builders/hcloud* @LKaemmerling
/website/pages/docs/builders/hcloud* @LKaemmerling
/builder/hyperone/ @m110 @gregorybrzeski @ad-m
/website/source/docs/builders/hyperone* @m110 @gregorybrzeski @ad-m
/website/pages/docs/builders/hyperone* @m110 @gregorybrzeski @ad-m
/builder/ucloud/ @shawnmssu
/website/source/docs/builders/ucloud* @shawnmssu
/website/pages/docs/builders/ucloud* @shawnmssu
/builder/yandex/ @GennadySpb @alexanderKhaustov @seukyaso
/website/source/docs/builders/yandex* @GennadySpb @alexanderKhaustov @seukyaso
/website/pages/docs/builders/yandex* @GennadySpb @alexanderKhaustov @seukyaso
/builder/osc/ @marinsalinas
/website/source/docs/builders/osc* @marinsalinas
/website/pages/docs/builders/osc* @marinsalinas
# provisioners

View File

@ -108,7 +108,7 @@ mode-check: ## Check that only certain files are executable
echo "Check passed."; \
fi
fmt-docs:
@find ./website/source/docs -name "*.md" -exec pandoc --wrap auto --columns 79 --atx-headers -s -f "markdown_github+yaml_metadata_block" -t "markdown_github+yaml_metadata_block" {} -o {} \;
@find ./website/pages/docs -name "*.md" -exec pandoc --wrap auto --columns 79 --atx-headers -s -f "markdown_github+yaml_metadata_block" -t "markdown_github+yaml_metadata_block" {} -o {} \;
# Install js-beautify with npm install -g js-beautify
fmt-examples:

View File

@ -17,7 +17,7 @@ type AlicloudDiskDevice struct {
// 128] English or Chinese characters, must begin with an
// uppercase/lowercase letter or Chinese character. Can contain numbers,
// ., _ and -. The disk name will appear on the console. It cannot
// begin with `http:// or `https://`.
// begin with `http://` or `https://`.
DiskName string `mapstructure:"disk_name" required:"false"`
// Category of the system disk. Optional values
// are:

View File

@ -61,7 +61,7 @@ type Config struct {
// exist and be writable.
BundleDestination string `mapstructure:"bundle_destination" required:"false"`
// The prefix for files created from bundling the root volume. By default
// this is `image-{{timestamp}}``. The timestamp variable should be used to
// this is `image-{{timestamp}}`. The timestamp variable should be used to
// make sure this is unique, otherwise it can collide with other created
// AMIs by Packer in your account.
BundlePrefix string `mapstructure:"bundle_prefix" required:"false"`

View File

@ -114,7 +114,7 @@ type Config struct {
SourceTemplate string `mapstructure:"source_template" required:"true"`
// The name of the temporary SSH key pair
// to generate. By default, Packer generates a name that looks like
// packer_<UUID>, where <UUID> is a 36 character unique identifier.
// `packer_<UUID>`, where `<UUID>` is a 36 character unique identifier.
TemporaryKeypairName string `mapstructure:"temporary_keypair_name" required:"false"`
// Set to true to indicate that the
// provisioners should connect to the local IP address of the instance.

View File

@ -20,11 +20,11 @@ type Config struct {
// The path to the lxc configuration file.
ConfigFile string `mapstructure:"config_file" required:"true"`
// The directory in which to save the exported
// tar.gz. Defaults to output-<BuildName> in the current directory.
// tar.gz. Defaults to `output-<BuildName>` in the current directory.
OutputDir string `mapstructure:"output_directory" required:"false"`
// The name of the LXC container. Usually stored
// in /var/lib/lxc/containers/<container_name>. Defaults to
// packer-<BuildName>.
// in `/var/lib/lxc/containers/<container_name>`. Defaults to
// `packer-<BuildName>`.
ContainerName string `mapstructure:"container_name" required:"false"`
// Allows you to specify a wrapper command, such
// as ssh so you can execute packer builds on a remote host. Defaults to
@ -53,7 +53,7 @@ type Config struct {
Name string `mapstructure:"template_name" required:"true"`
// Options to pass to the given
// lxc-template command, usually located in
// /usr/share/lxc/templates/lxc-<template_name>. Note: This gets passed as
// `/usr/share/lxc/templates/lxc-<template_name>`. Note: This gets passed as
// ARGV to the template command. Ensure you have an array of strings, as a
// single string with spaces probably won't work. Defaults to [].
Parameters []string `mapstructure:"template_parameters" required:"false"`

View File

@ -66,13 +66,9 @@ type RunConfig struct {
// following are valid:
//
// - name (string)
//
// - owner (string)
//
// - tags (array of strings)
//
// - visibility (string)
//
// - properties (map of strings to strings) (fields that can be set
// with `openstack image set --property key=value`)
//

View File

@ -39,8 +39,7 @@ type ExportConfig struct {
// packer call like this (shell `>` continuation character snipped for easier
// copy & paste):
//
// ``` {.shell}
//
// ``` shell
// vm_description='some
// multiline
// description'

View File

@ -64,18 +64,18 @@ func main() {
header := Struct{
SourcePath: sourcePath,
Name: typeSpec.Name.Name,
Filename: "_" + typeSpec.Name.Name + ".html.md",
Filename: typeSpec.Name.Name + ".mdx",
Header: typeDecl.Doc.Text(),
}
required := Struct{
SourcePath: sourcePath,
Name: typeSpec.Name.Name,
Filename: "_" + typeSpec.Name.Name + "-required.html.md",
Filename: typeSpec.Name.Name + "-required.mdx",
}
notRequired := Struct{
SourcePath: sourcePath,
Name: typeSpec.Name.Name,
Filename: "_" + typeSpec.Name.Name + "-not-required.html.md",
Filename: typeSpec.Name.Name + "-not-required.mdx",
}
for _, field := range fields {
@ -133,7 +133,7 @@ func main() {
}
}
dir := filepath.Join(packerDir, "website", "source", "partials", builderName)
dir := filepath.Join(packerDir, "website", "pages", "partials", builderName)
os.MkdirAll(dir, 0755)
for _, str := range []Struct{header, required, notRequired} {

View File

@ -175,7 +175,7 @@ type WinRM struct {
//
// NOTE: If using an Amazon EBS builder, you can specify the interface
// WinRM connects to via
// [`ssh_interface`](https://www.packer.io/docs/builders/amazon-ebs#ssh_interface)
// [`ssh_interface`](/docs/builders/amazon-ebs#ssh_interface)
WinRMHost string `mapstructure:"winrm_host"`
// The WinRM port to connect to. This defaults to `5985` for plain
// unencrypted connection and `5986` for SSL when `winrm_use_ssl` is set to

View File

@ -4,7 +4,7 @@
128] English or Chinese characters, must begin with an
uppercase/lowercase letter or Chinese character. Can contain numbers,
., \_ and -. The disk name will appear on the console. It cannot
begin with http:// or https://.
begin with `http://` or `https://`.
- `disk_category` (string) - Category of the system disk. Optional values
are: - cloud - general cloud disk - cloud_efficiency - efficiency cloud disk - cloud_ssd - cloud SSD
@ -19,7 +19,7 @@
- `disk_description` (string) - The value of disk description is blank by
default. [2, 256] characters. The disk description will appear on the
console. It cannot begin with http:// or https://.
console. It cannot begin with `http://` or `https://`.
- `disk_delete_with_instance` (bool) - Whether or not the disk is
released along with the instance:

View File

@ -5,7 +5,7 @@
- `image_description` (string) - The description of the image, with a length
limit of 0 to 256 characters. Leaving it blank means null, which is the
default value. It cannot begin with http:// or https://.
default value. It cannot begin with `http://` or `https://`.
- `image_share_account` ([]string) - The IDs of to-be-added Aliyun
accounts to which the image is shared. The number of accounts is 1 to 10.
@ -17,7 +17,7 @@
- `image_copy_names` ([]string) - The name of the destination image,
[2, 128] English or Chinese characters. It must begin with an
uppercase/lowercase letter or a Chinese character, and may contain numbers,
\_ or -. It cannot begin with http:// or https://.
\_ or -. It cannot begin with `http://` or `https://`.
- `image_encrypted` (boolean) - Whether or not to encrypt the target images, including those copied if image_copy_regions is specified. If this option
is set to true, a temporary image will be created from the provisioned

View File

@ -3,4 +3,4 @@
- `image_name` (string) - The name of the user-defined image, [2, 128]
English or Chinese characters. It must begin with an uppercase/lowercase
letter or a Chinese character, and may contain numbers, \_ or -. It
cannot begin with http:// or https://.
cannot begin with `http://` or `https://`.

View File

@ -48,8 +48,8 @@
- `vpc_name` (string) - The VPC name. The default value is blank. [2, 128]
English or Chinese characters, must begin with an uppercase/lowercase
letter or Chinese character. Can contain numbers, \_ and -. The disk
description will appear on the console. Cannot begin with http:// or
https://.
description will appear on the console. Cannot begin with `http://` or
`https://`.
- `vpc_cidr_block` (string) - Value options: 192.168.0.0/16 and
172.16.0.0/16. When not specified, the default value is 172.16.0.0/16.

View File

@ -1,3 +1,2 @@
<!-- Code generated from the comments of the AccessConfig struct in builder/amazon/common/access_config.go; DO NOT EDIT MANUALLY -->
AccessConfig is for common configuration related to AWS access

View File

@ -58,7 +58,7 @@
Instances, e.g. when the `spot_price` option has been configured.
Attempting to do so will cause an error.
!> **Warning!** Additional costs may be incurred by enabling T2
!&gt; **Warning!** Additional costs may be incurred by enabling T2
Unlimited - even for instances that would usually qualify for the
[AWS Free Tier](https://aws.amazon.com/free/).

View File

@ -1,4 +1,3 @@
<!-- Code generated from the comments of the RunConfig struct in builder/amazon/common/run_config.go; DO NOT EDIT MANUALLY -->
RunConfig contains configuration for running an instance from a source
AMI and details on how to access that launched image.

View File

@ -5,7 +5,7 @@
- `container_name` (string) - Container Name
- `command_wrapper` (string) - Lets you prefix all builder commands, such as
with ssh for a remote build host. Defaults to "{{.Command}}"; i.e. no
with ssh for a remote build host. Defaults to `{{.Command}}`; i.e. no
wrapper.
- `profile` (string) - Profile

View File

@ -9,17 +9,17 @@
accelerator you specified. When no accelerator is specified, Packer will try
to use `kvm` if it is available but will default to `tcg` otherwise.
-> The `hax` accelerator has issues attaching CDROM ISOs. This is an
-&gt; The `hax` accelerator has issues attaching CDROM ISOs. This is an
upstream issue which can be tracked
[here](https://github.com/intel/haxm/issues/20).
-> The `hvf` and `whpx` accelerator are new and experimental as of
-&gt; The `hvf` and `whpx` accelerator are new and experimental as of
[QEMU 2.12.0](https://wiki.qemu.org/ChangeLog/2.12#Host_support).
You may encounter issues unrelated to Packer when using these. You may need to
add [ "-global", "virtio-pci.disable-modern=on" ] to `qemuargs` depending on the
guest operating system.
-> For `whpx`, note that [Stefan Weil's QEMU for Windows distribution](https://qemu.weilnetz.de/w64/)
-&gt; For `whpx`, note that [Stefan Weil's QEMU for Windows distribution](https://qemu.weilnetz.de/w64/)
does not include WHPX support and users may need to compile or source a
build of QEMU for Windows themselves with WHPX support.
@ -121,7 +121,7 @@
as an empty string is ignored. All values after the switch are
concatenated with no separator.
~> **Warning:** The qemu command line allows extreme flexibility, so
~&gt; **Warning:** The qemu command line allows extreme flexibility, so
beware of conflicting arguments causing failures of your run. For
instance, using --no-acpi could break the ability to send power signal
type commands (e.g., shutdown -P now) to the virtual machine, thus
@ -156,7 +156,7 @@
virtio-net,netdev=mynet0"
```
~> **Windows Users:** [QEMU for Windows](https://qemu.weilnetz.de/)
~&gt; **Windows Users:** [QEMU for Windows](https://qemu.weilnetz.de/)
builds are available though an environmental variable does need to be
set for QEMU for Windows to redirect stdout to the console instead of
stdout.txt.

View File

@ -33,6 +33,7 @@
copy & paste):
```shell
vm_description='some
multiline
description'