From 4939ea1a3bbd259a3a2edb07e5bc551267f43d05 Mon Sep 17 00:00:00 2001 From: Tadas Medisauskas Date: Thu, 22 Dec 2016 14:59:25 +0000 Subject: [PATCH 001/132] Add support for Hyper-V admins security group --- builder/hyperv/common/driver_ps_4.go | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/builder/hyperv/common/driver_ps_4.go b/builder/hyperv/common/driver_ps_4.go index 030ee8f55..ae125259a 100644 --- a/builder/hyperv/common/driver_ps_4.go +++ b/builder/hyperv/common/driver_ps_4.go @@ -64,7 +64,7 @@ func (d *HypervPS4Driver) Verify() error { return err } - if err := d.verifyElevatedMode(); err != nil { + if err := d.verifyHypervPermissions(); err != nil { return err } @@ -293,16 +293,28 @@ func (d *HypervPS4Driver) verifyPSHypervModule() error { return nil } -func (d *HypervPS4Driver) verifyElevatedMode() error { +func (d *HypervPS4Driver) verifyHypervPermissions() error { - log.Printf("Enter method: %s", "verifyElevatedMode") + log.Printf("Enter method: %s", "verifyHypervPermissions") - isAdmin, _ := powershell.IsCurrentUserAnAdministrator() + hypervAdminCmd := "([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole('Hyper-V Administrators')" - if !isAdmin { - err := fmt.Errorf("%s", "Please restart your shell in elevated mode") + var ps powershell.PowerShellCmd + cmdOut, err := ps.Output(hypervAdminCmd) + if err != nil { return err } + res := strings.TrimSpace(string(cmdOut)) + + if res == "False" { + isAdmin, _ := powershell.IsCurrentUserAnAdministrator() + + if !isAdmin { + err := fmt.Errorf("%s", "Current user is not a member of 'Hyper-V Administrators' or 'Administrators' group") + return err + } + } + return nil } From 85e85ddb470bab99fec1ef09edd1c1e8329a71aa Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Sat, 21 Jan 2017 21:45:08 -0800 Subject: [PATCH 002/132] communicator/winrm: make directory upload behave more like scp changes behavior to be in-line with the docs. Resolves #3562 --- communicator/winrm/communicator.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/communicator/winrm/communicator.go b/communicator/winrm/communicator.go index c0676d01f..d3c6ee46d 100644 --- a/communicator/winrm/communicator.go +++ b/communicator/winrm/communicator.go @@ -5,6 +5,8 @@ import ( "io" "log" "os" + "path/filepath" + "strings" "sync" "github.com/masterzen/winrm" @@ -129,6 +131,9 @@ func (c *Communicator) Upload(path string, input io.Reader, _ *os.FileInfo) erro // UploadDir implementation of communicator.Communicator interface func (c *Communicator) UploadDir(dst string, src string, exclude []string) error { + if !strings.HasSuffix(src, "/") { + dst = fmt.Sprintf("%s\\%s", dst, filepath.Base(src)) + } log.Printf("Uploading dir '%s' to '%s'", src, dst) wcp, err := c.newCopyClient() if err != nil { From 4eed1b8377b83441a941612629b1031af4641ceb Mon Sep 17 00:00:00 2001 From: hfinucane Date: Wed, 22 Feb 2017 10:32:49 -0800 Subject: [PATCH 003/132] Fix example `device_setup_commands` appears to no longer be a real name. --- website/source/docs/builders/amazon-chroot.html.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/source/docs/builders/amazon-chroot.html.md b/website/source/docs/builders/amazon-chroot.html.md index 97f575b2e..227e96b94 100644 --- a/website/source/docs/builders/amazon-chroot.html.md +++ b/website/source/docs/builders/amazon-chroot.html.md @@ -370,7 +370,7 @@ provisioning commands to install the os and bootloader. "ami_name": "packer-from-scratch {{timestamp}}" "from_scratch": true, "ami_virtualization_type": "hvm", - "device_setup_commands": [ + "pre_mount_commands": [ "parted {{.Device}} mklabel msdos mkpart primary 1M 100% set 1 boot on print", "mkfs.ext4 {{.Device}}1" ], From 52d4514d6a40350cf079561d45353c7577ff23fc Mon Sep 17 00:00:00 2001 From: huiyang Date: Fri, 3 Mar 2017 15:32:51 -0800 Subject: [PATCH 004/132] builder/parallels-iso: Configuration of disk type, plain or expanding --- builder/parallels/iso/builder.go | 10 +++++ builder/parallels/iso/builder_test.go | 41 +++++++++++++++++++ builder/parallels/iso/step_create_disk.go | 1 + command/plugin.go | 2 +- .../docs/builders/parallels-iso.html.md | 15 +++++-- 5 files changed, 64 insertions(+), 5 deletions(-) diff --git a/builder/parallels/iso/builder.go b/builder/parallels/iso/builder.go index 8aefdf762..cfe6241a8 100644 --- a/builder/parallels/iso/builder.go +++ b/builder/parallels/iso/builder.go @@ -37,6 +37,7 @@ type Config struct { BootCommand []string `mapstructure:"boot_command"` DiskSize uint `mapstructure:"disk_size"` + DiskType string `mapstructure:"disk_type"` GuestOSType string `mapstructure:"guest_os_type"` HardDriveInterface string `mapstructure:"hard_drive_interface"` HostInterfaces []string `mapstructure:"host_interfaces"` @@ -87,6 +88,10 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { b.config.DiskSize = 40000 } + if b.config.DiskType == "" { + b.config.DiskType = "expand" + } + if b.config.HardDriveInterface == "" { b.config.HardDriveInterface = "sata" } @@ -104,6 +109,11 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { b.config.VMName = fmt.Sprintf("packer-%s", b.config.PackerBuildName) } + if b.config.DiskType != "expand" && b.config.DiskType != "plain" { + errs = packer.MultiErrorAppend( + errs, errors.New("disk_type can only be expand, or plain")) + } + if b.config.HardDriveInterface != "ide" && b.config.HardDriveInterface != "sata" && b.config.HardDriveInterface != "scsi" { errs = packer.MultiErrorAppend( errs, errors.New("hard_drive_interface can only be ide, sata, or scsi")) diff --git a/builder/parallels/iso/builder_test.go b/builder/parallels/iso/builder_test.go index 7be21bd59..668ec1c07 100644 --- a/builder/parallels/iso/builder_test.go +++ b/builder/parallels/iso/builder_test.go @@ -130,6 +130,47 @@ func TestBuilderPrepare_DiskSize(t *testing.T) { } } +func TestBuilderPrepare_DiskType(t *testing.T) { + var b Builder + config := testConfig() + + // Test a default boot_wait + delete(config, "disk_type") + warns, err := b.Prepare(config) + if len(warns) > 0 { + t.Fatalf("bad: %#v", warns) + } + if err != nil { + t.Fatalf("err: %s", err) + } + + if b.config.DiskType != "expand" { + t.Fatalf("bad: %s", b.config.DiskType) + } + + // Test with a bad + config["disk_type"] = "fake" + b = Builder{} + warns, err = b.Prepare(config) + if len(warns) > 0 { + t.Fatalf("bad: %#v", warns) + } + if err == nil { + t.Fatal("should have error") + } + + // Test with a good + config["disk_type"] = "plain" + b = Builder{} + warns, err = b.Prepare(config) + if len(warns) > 0 { + t.Fatalf("bad: %#v", warns) + } + if err != nil { + t.Fatalf("should not have error: %s", err) + } +} + func TestBuilderPrepare_HardDriveInterface(t *testing.T) { var b Builder config := testConfig() diff --git a/builder/parallels/iso/step_create_disk.go b/builder/parallels/iso/step_create_disk.go index e8f458f82..1737dcf6a 100644 --- a/builder/parallels/iso/step_create_disk.go +++ b/builder/parallels/iso/step_create_disk.go @@ -22,6 +22,7 @@ func (s *stepCreateDisk) Run(state multistep.StateBag) multistep.StepAction { command := []string{ "set", vmName, "--device-add", "hdd", + "--type", config.DiskType, "--size", strconv.FormatUint(uint64(config.DiskSize), 10), "--iface", config.HardDriveInterface, } diff --git a/command/plugin.go b/command/plugin.go index 8f09f0a74..bb76efbfe 100644 --- a/command/plugin.go +++ b/command/plugin.go @@ -75,8 +75,8 @@ type PluginCommand struct { var Builders = map[string]packer.Builder{ "amazon-chroot": new(amazonchrootbuilder.Builder), "amazon-ebs": new(amazonebsbuilder.Builder), - "amazon-ebsvolume": new(amazonebsvolumebuilder.Builder), "amazon-ebssurrogate": new(amazonebssurrogatebuilder.Builder), + "amazon-ebsvolume": new(amazonebsvolumebuilder.Builder), "amazon-instance": new(amazoninstancebuilder.Builder), "azure-arm": new(azurearmbuilder.Builder), "cloudstack": new(cloudstackbuilder.Builder), diff --git a/website/source/docs/builders/parallels-iso.html.md b/website/source/docs/builders/parallels-iso.html.md index 09bf750d7..4f3d73c4f 100644 --- a/website/source/docs/builders/parallels-iso.html.md +++ b/website/source/docs/builders/parallels-iso.html.md @@ -105,6 +105,13 @@ builder. - `disk_size` (integer) - The size, in megabytes, of the hard disk to create for the VM. By default, this is 40000 (about 40 GB). +- `disk_type` (string) - The type for image file based virtual disk drives, + defaults to `expand`. Valid options are `expand` (expanding disk) that the + image file is small initially and grows in size as you add data to it, and + `plain` (plain disk) that the image file has a fixed size from the moment it + is created (i.e the space is allocated for the drive fully). Plain disks + perform faster than expanding disks. + - `floppy_files` (array of strings) - A list of files to place onto a floppy disk that is attached when the VM is booted. This is most useful for unattended Windows installs, which look for an `Autounattend.xml` file on @@ -273,7 +280,7 @@ proper key: - `` `` - Simulates pressing and holding the alt key. -- `` `` - Simulates pressing and holding the ctrl key. +- `` `` - Simulates pressing and holding the ctrl key. - `` `` - Simulates pressing and holding the shift key. @@ -287,9 +294,9 @@ proper key: sending any additional keys. This is useful if you have to generally wait for the UI to update before typing more. -When using modifier keys `ctrl`, `alt`, `shift` ensure that you release them, -otherwise they will be held down until the machine reboots. Use lowercase -characters as well inside modifiers. +When using modifier keys `ctrl`, `alt`, `shift` ensure that you release them, +otherwise they will be held down until the machine reboots. Use lowercase +characters as well inside modifiers. For example: to simulate ctrl+c use `c`. From 37feec41d9fe625a8c19a76d8f1d29063b0875b6 Mon Sep 17 00:00:00 2001 From: Kerim Satirli Date: Mon, 6 Mar 2017 09:44:07 +0100 Subject: [PATCH 005/132] fixes broken link to EBS surrogate page --- website/source/docs/builders/amazon.html.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/source/docs/builders/amazon.html.md b/website/source/docs/builders/amazon.html.md index 50c39b901..82aab89af 100644 --- a/website/source/docs/builders/amazon.html.md +++ b/website/source/docs/builders/amazon.html.md @@ -28,7 +28,7 @@ Packer supports the following builders at the moment: newcomers**. However, it is also the fastest way to build an EBS-backed AMI since no new EC2 instance needs to be launched. -- [amazon-ebssurrogate](/docs/builders/amazone-ebssurrogate.html) - Create EBS +- [amazon-ebssurrogate](/docs/builders/amazon-ebssurrogate.html) - Create EBS -backed AMIs from scratch. Works similarly to the `chroot` builder but does not require running in AWS. This is an **advanced builder and should not be used by newcomers**. From ded2693ee7f74b197655027c211b47d99c08b480 Mon Sep 17 00:00:00 2001 From: Michael Ledin Date: Sun, 5 Mar 2017 16:55:48 +0300 Subject: [PATCH 006/132] Add floppy size limitation notice. Should help people dealing with #4570 and #3328 because packer copies `floppy_files` to floppy without any error even if they exceed 1.44 MB limit. `floppy_dirs`throws error about FAT size limit exceeded but without mentioning that real issue is the floppy size limit: ``` Build 'qemu' errored: Error adding path virtio_iso to floppy: FAT FULL ``` --- website/source/docs/builders/qemu.html.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/source/docs/builders/qemu.html.md b/website/source/docs/builders/qemu.html.md index 381e8872f..28fe8400e 100644 --- a/website/source/docs/builders/qemu.html.md +++ b/website/source/docs/builders/qemu.html.md @@ -172,13 +172,13 @@ Linux server and have not enabled X11 forwarding (`ssh -X`). is attached as the first floppy device. Currently, no support exists for creating sub-directories on the floppy. Wildcard characters (\*, ?, and \[\]) are allowed. Directory names are also allowed, which will add all - the files found in the directory to the floppy. + the files found in the directory to the floppy. The summary size of the listed files must not exceed 1.44 MB. The supported ways to move large files into the OS are using `http_directory` or [the file provisioner]( https://www.packer.io/docs/provisioners/file.html). - `floppy_dirs` (array of strings) - A list of directories to place onto the floppy disk recursively. This is similar to the `floppy_files` option except that the directory structure is preserved. This is useful for when your floppy disk includes drivers or if you just want to organize it's - contents as a hierarchy. Wildcard characters (\*, ?, and \[\]) are allowed. + contents as a hierarchy. Wildcard characters (\*, ?, and \[\]) are allowed. The maximum summary size of all files in the listed directories are the same as in `floppy_files`. - `format` (string) - Either "qcow2" or "raw", this specifies the output format of the virtual machine image. This defaults to `qcow2`. From 5ac53907c28114185435eb1ed188c9511ddfda94 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 6 Mar 2017 10:25:32 -0800 Subject: [PATCH 007/132] docs/qemu: reformat --- website/source/docs/builders/qemu.html.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/website/source/docs/builders/qemu.html.md b/website/source/docs/builders/qemu.html.md index 28fe8400e..813ef0a6c 100644 --- a/website/source/docs/builders/qemu.html.md +++ b/website/source/docs/builders/qemu.html.md @@ -172,13 +172,18 @@ Linux server and have not enabled X11 forwarding (`ssh -X`). is attached as the first floppy device. Currently, no support exists for creating sub-directories on the floppy. Wildcard characters (\*, ?, and \[\]) are allowed. Directory names are also allowed, which will add all - the files found in the directory to the floppy. The summary size of the listed files must not exceed 1.44 MB. The supported ways to move large files into the OS are using `http_directory` or [the file provisioner]( https://www.packer.io/docs/provisioners/file.html). + the files found in the directory to the floppy. The summary size of the + listed files must not exceed 1.44 MB. The supported ways to move large + files into the OS are using `http_directory` or [the file provisioner]( + https://www.packer.io/docs/provisioners/file.html). - `floppy_dirs` (array of strings) - A list of directories to place onto the floppy disk recursively. This is similar to the `floppy_files` option except that the directory structure is preserved. This is useful for when your floppy disk includes drivers or if you just want to organize it's - contents as a hierarchy. Wildcard characters (\*, ?, and \[\]) are allowed. The maximum summary size of all files in the listed directories are the same as in `floppy_files`. + contents as a hierarchy. Wildcard characters (\*, ?, and \[\]) are allowed. + The maximum summary size of all files in the listed directories are the + same as in `floppy_files`. - `format` (string) - Either "qcow2" or "raw", this specifies the output format of the virtual machine image. This defaults to `qcow2`. @@ -417,7 +422,10 @@ command, they will be replaced by the proper key: - ` ` - Add user defined time.Duration pause before sending any additional keys. For example `` or `` -When using modifier keys `ctrl`, `alt`, `shift` ensure that you release them, otherwise they will be held down until the machine reboots. Use lowercase characters as well inside modifiers. For example: to simulate ctrl+c use `c`. +When using modifier keys `ctrl`, `alt`, `shift` ensure that you release them, +otherwise they will be held down until the machine reboots. Use lowercase +characters as well inside modifiers. For example: to simulate ctrl+c use +`c`. In addition to the special keys, each command to type is treated as a [configuration template](/docs/templates/configuration-templates.html). The From 57d2fede3f880a07d0c1fa8b1252869eb687d644 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 6 Mar 2017 13:08:34 -0800 Subject: [PATCH 008/132] the digitalocean ubuntu user is root --- website/source/docs/builders/digitalocean.html.md | 7 ++++--- .../source/intro/getting-started/parallel-builds.html.md | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/website/source/docs/builders/digitalocean.html.md b/website/source/docs/builders/digitalocean.html.md index b63bb103d..c8ce84f39 100644 --- a/website/source/docs/builders/digitalocean.html.md +++ b/website/source/docs/builders/digitalocean.html.md @@ -88,8 +88,9 @@ access tokens: { "type": "digitalocean", "api_token": "YOUR API KEY", - "image": "ubuntu-12-04-x64", - "region": "nyc2", - "size": "512mb" + "image": "ubuntu-14-04-x64", + "region": "nyc3", + "size": "512mb", + "ssh_username": "root" } ``` diff --git a/website/source/intro/getting-started/parallel-builds.html.md b/website/source/intro/getting-started/parallel-builds.html.md index 0125cf9df..c1e5703e8 100644 --- a/website/source/intro/getting-started/parallel-builds.html.md +++ b/website/source/intro/getting-started/parallel-builds.html.md @@ -68,7 +68,7 @@ array. "image": "ubuntu-14-04-x64", "region": "nyc3", "size": "512mb", - "ssh_username": "ubuntu" + "ssh_username": "root" } ``` @@ -106,7 +106,7 @@ The entire template should now look like this: "image": "ubuntu-14-04-x64", "region": "nyc3", "size": "512mb", - "ssh_username": "ubuntu" + "ssh_username": "root" }], "provisioners": [{ "type": "shell", From b3c6ef9f6bff04dc568f4c6efef6613eaf9939e9 Mon Sep 17 00:00:00 2001 From: huiyang Date: Tue, 7 Mar 2017 18:22:23 -0800 Subject: [PATCH 009/132] Skip disk compaction for plain disks --- builder/parallels/iso/builder.go | 6 ++++++ builder/parallels/iso/builder_test.go | 18 ++++++++++++++++-- .../source/docs/builders/parallels-iso.html.md | 10 ++++++---- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/builder/parallels/iso/builder.go b/builder/parallels/iso/builder.go index cfe6241a8..e53509c50 100644 --- a/builder/parallels/iso/builder.go +++ b/builder/parallels/iso/builder.go @@ -114,6 +114,12 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) { errs, errors.New("disk_type can only be expand, or plain")) } + if b.config.DiskType == "plain" && !b.config.SkipCompaction { + b.config.SkipCompaction = true + warnings = append(warnings, + "'skip_compaction' is enforced to be true for plain disks.") + } + if b.config.HardDriveInterface != "ide" && b.config.HardDriveInterface != "sata" && b.config.HardDriveInterface != "scsi" { errs = packer.MultiErrorAppend( errs, errors.New("hard_drive_interface can only be ide, sata, or scsi")) diff --git a/builder/parallels/iso/builder_test.go b/builder/parallels/iso/builder_test.go index 668ec1c07..b43da12f9 100644 --- a/builder/parallels/iso/builder_test.go +++ b/builder/parallels/iso/builder_test.go @@ -134,7 +134,7 @@ func TestBuilderPrepare_DiskType(t *testing.T) { var b Builder config := testConfig() - // Test a default boot_wait + // Test a default disk_type delete(config, "disk_type") warns, err := b.Prepare(config) if len(warns) > 0 { @@ -159,8 +159,21 @@ func TestBuilderPrepare_DiskType(t *testing.T) { t.Fatal("should have error") } - // Test with a good + // Test with plain disk with wrong setting for compaction config["disk_type"] = "plain" + config["skip_compaction"] = false + b = Builder{} + warns, err = b.Prepare(config) + if len(warns) == 0 { + t.Fatalf("should have warning") + } + if err != nil { + t.Fatalf("should not have error: %s", err) + } + + // Test with plain disk with correct setting for compaction + config["disk_type"] = "plain" + config["skip_compaction"] = true b = Builder{} warns, err = b.Prepare(config) if len(warns) > 0 { @@ -169,6 +182,7 @@ func TestBuilderPrepare_DiskType(t *testing.T) { if err != nil { t.Fatalf("should not have error: %s", err) } + } func TestBuilderPrepare_HardDriveInterface(t *testing.T) { diff --git a/website/source/docs/builders/parallels-iso.html.md b/website/source/docs/builders/parallels-iso.html.md index 4f3d73c4f..fa221b7ed 100644 --- a/website/source/docs/builders/parallels-iso.html.md +++ b/website/source/docs/builders/parallels-iso.html.md @@ -110,7 +110,8 @@ builder. image file is small initially and grows in size as you add data to it, and `plain` (plain disk) that the image file has a fixed size from the moment it is created (i.e the space is allocated for the drive fully). Plain disks - perform faster than expanding disks. + perform faster than expanding disks. `skip_compaction` will be set to true + automatically for plain disks. - `floppy_files` (array of strings) - A list of files to place onto a floppy disk that is attached when the VM is booted. This is most useful for @@ -225,9 +226,10 @@ builder. "5m", or five minutes. - `skip_compaction` (boolean) - Virtual disk image is compacted at the end of - the build process using `prl_disk_tool` utility. In certain rare cases, this - might corrupt the resulting disk image. If you find this to be the case, - you can disable compaction using this configuration value. + the build process using `prl_disk_tool` utility (except for the case that + `disk_type` is set to `plain`). In certain rare cases, this might corrupt + the resulting disk image. If you find this to be the case, you can disable + compaction using this configuration value. - `vm_name` (string) - This is the name of the PVM directory for the new virtual machine, without the file extension. By default this is From 2300b102b7f87c73c62f4ac0c90e6f5fe1130dea Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Wed, 8 Mar 2017 18:12:37 +0100 Subject: [PATCH 010/132] amazon: Step Region Copy crashing on device mapping Closes #4635 --- builder/amazon/common/step_ami_region_copy.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builder/amazon/common/step_ami_region_copy.go b/builder/amazon/common/step_ami_region_copy.go index 1f4e65738..96496fe47 100644 --- a/builder/amazon/common/step_ami_region_copy.go +++ b/builder/amazon/common/step_ami_region_copy.go @@ -2,7 +2,6 @@ package common import ( "fmt" - "sync" "github.com/aws/aws-sdk-go/aws" @@ -128,7 +127,7 @@ func amiRegionCopy(state multistep.StateBag, config *AccessConfig, name string, } for _, blockDeviceMapping := range describeImageResp.Images[0].BlockDeviceMappings { - if blockDeviceMapping.Ebs != nil { + if blockDeviceMapping.Ebs != nil && blockDeviceMapping.Ebs.SnapshotId != nil { snapshotIds = append(snapshotIds, *blockDeviceMapping.Ebs.SnapshotId) } } From eac5b6392d5382c46ad494b184a0ac5944abc3b4 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Wed, 8 Mar 2017 19:44:07 +0100 Subject: [PATCH 011/132] googlecompute: Correct values for on_host_maintenance If preemptible is true then on_host_maintenance must be TERMINATE. Also corrected order in docs. Closes #4620 --- builder/googlecompute/config.go | 19 ++++++++++++------- .../docs/builders/googlecompute.html.md | 11 +++++------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/builder/googlecompute/config.go b/builder/googlecompute/config.go index 78141bed4..330ea5900 100644 --- a/builder/googlecompute/config.go +++ b/builder/googlecompute/config.go @@ -93,15 +93,20 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) { if c.ImageDescription == "" { c.ImageDescription = "Created by Packer" } - // Setting OnHostMaintenance Correct Defaults - // "MIGRATE" : Possible if Preemptible is false - // "TERMINATE": Posssible if Preemptible is true - if c.OnHostMaintenance == "" && c.Preemptible { - c.OnHostMaintenance = "MIGRATE" - } - if c.OnHostMaintenance == "" && !c.Preemptible { + if c.OnHostMaintenance == "MIGRATE" && c.Preemptible { + errs = packer.MultiErrorAppend(errs, + errors.New("on_host_maintenance must be TERMINATE when using preemptible instances.")) + } + // Setting OnHostMaintenance Correct Defaults + // "MIGRATE" : Possible and default if Preemptible is false + // "TERMINATE": Required if Preemptible is true + if c.Preemptible { c.OnHostMaintenance = "TERMINATE" + } else { + if c.OnHostMaintenance == "" { + c.OnHostMaintenance = "MIGRATE" + } } // Make sure user sets a valid value for on_host_maintenance option diff --git a/website/source/docs/builders/googlecompute.html.md b/website/source/docs/builders/googlecompute.html.md index 97dac1a70..9f41bef9b 100644 --- a/website/source/docs/builders/googlecompute.html.md +++ b/website/source/docs/builders/googlecompute.html.md @@ -177,15 +177,14 @@ builder. - `omit_external_ip` (boolean) - If true, the instance will not have an external IP. `use_internal_ip` must be true if this property is true. -- `preemptible` (boolean) - If true, launch a preembtible instance. - - `on_host_maintenance` (string) - Sets Host Maintenance Option. Valid choices are `MIGRATE` and `TERMINATE`. Please see [GCE Instance Scheduling Options](https://cloud.google.com/compute/docs/instances/setting-instance-scheduling-options), - as not all machine_types support `MIGRATE` (i.e. machines with GPUs). The - default value depends on preemtability. - - when preemptible == true, defaults to `TERMINATE` - - when preemptible == false, defaults to `MIGRATE` + as not all machine_types support `MIGRATE` (i.e. machines with GPUs). + If preemptible is true this can only be `TERMINATE`. If preemptible + is false, it defaults to `MIGRATE` + +- `preemptible` (boolean) - If true, launch a preembtible instance. - `region` (string) - The region in which to launch the instance. Defaults to to the region hosting the specified `zone`. From 2f50d7bea5761adc5f7468a343625a3e8b01bc35 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Wed, 8 Mar 2017 19:47:08 +0100 Subject: [PATCH 012/132] googlecompute: Added missing disk_name option to docs. --- website/source/docs/builders/googlecompute.html.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/source/docs/builders/googlecompute.html.md b/website/source/docs/builders/googlecompute.html.md index 9f41bef9b..6b3924874 100644 --- a/website/source/docs/builders/googlecompute.html.md +++ b/website/source/docs/builders/googlecompute.html.md @@ -145,6 +145,9 @@ builder. - `address` (string) - The name of a pre-allocated static external IP address. Note, must be the name and not the actual IP address. +- `disk_name` (string) - The name of the disk, if unset the instance name will be + used. + - `disk_size` (integer) - The size of the disk in GB. This defaults to `10`, which is 10GB. From 24264ef0dc85df3e5b6cb438fbf5e267a75ca95e Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Wed, 8 Mar 2017 11:22:54 -0800 Subject: [PATCH 013/132] Update middleman-hashicorp --- website/Gemfile | 5 +--- website/Gemfile.lock | 62 +++++++++++++++++++++----------------------- website/Makefile | 32 +++++++++-------------- website/README.md | 34 ++++++++---------------- website/Vagrantfile | 27 ------------------- website/packer.json | 18 +++++-------- 6 files changed, 59 insertions(+), 119 deletions(-) delete mode 100644 website/Vagrantfile diff --git a/website/Gemfile b/website/Gemfile index 76e7fafef..f9b604b3c 100644 --- a/website/Gemfile +++ b/website/Gemfile @@ -1,6 +1,3 @@ source "https://rubygems.org" -gem "middleman-hashicorp", - git: "https://github.com/hashicorp/middleman-hashicorp.git" - -gem "htmlbeautifier" +gem "middleman-hashicorp", "0.3.12" diff --git a/website/Gemfile.lock b/website/Gemfile.lock index b5fe9cc0f..ff3b5b7b0 100644 --- a/website/Gemfile.lock +++ b/website/Gemfile.lock @@ -1,30 +1,17 @@ -GIT - remote: https://github.com/hashicorp/middleman-hashicorp.git - revision: 462267352881543bbc5d2606f1ca17a6165ac8ec - specs: - middleman-hashicorp (0.3.5) - bootstrap-sass (~> 3.3) - builder (~> 3.2) - middleman (~> 3.4) - middleman-livereload (~> 3.4) - middleman-syntax (~> 3.0) - redcarpet (~> 3.3) - GEM remote: https://rubygems.org/ specs: - activesupport (4.2.7.1) + activesupport (4.2.8) i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - autoprefixer-rails (6.5.3) + autoprefixer-rails (6.7.6) execjs bootstrap-sass (3.3.7) autoprefixer-rails (>= 5.2.1) sass (>= 3.3.4) - builder (3.2.2) + builder (3.2.3) capybara (2.4.4) mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -35,7 +22,7 @@ GEM coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.10.0) + coffee-script-source (1.12.2) compass (1.0.3) chunky_png (~> 1.2) compass-core (~> 1.0.2) @@ -52,19 +39,18 @@ GEM eventmachine (>= 0.12.9) http_parser.rb (~> 0.6.0) erubis (2.7.0) - eventmachine (1.2.0.1) + eventmachine (1.2.3) execjs (2.7.0) - ffi (1.9.14) + ffi (1.9.18) haml (4.0.7) tilt hike (1.2.3) hooks (0.4.1) uber (~> 0.0.14) - htmlbeautifier (1.2.0) http_parser.rb (0.6.0) i18n (0.7.0) - json (1.8.3) - kramdown (1.12.0) + json (2.0.3) + kramdown (1.13.2) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -91,6 +77,14 @@ GEM rack (>= 1.4.5, < 2.0) thor (>= 0.15.2, < 2.0) tilt (~> 1.4.1, < 2.0) + middleman-hashicorp (0.3.12) + bootstrap-sass (~> 3.3) + builder (~> 3.2) + middleman (~> 3.4) + middleman-livereload (~> 3.4) + middleman-syntax (~> 3.0) + redcarpet (~> 3.3) + turbolinks (~> 5.0) middleman-livereload (3.4.6) em-websocket (~> 0.5.1) middleman-core (>= 3.3) @@ -107,9 +101,9 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mini_portile2 (2.1.0) - minitest (5.9.1) + minitest (5.10.1) multi_json (1.12.1) - nokogiri (1.6.8.1) + nokogiri (1.7.0.1) mini_portile2 (~> 2.1.0) padrino-helpers (0.12.8.1) i18n (~> 0.6, >= 0.6.7) @@ -123,11 +117,11 @@ GEM rack-test (0.6.3) rack (>= 1.0) rb-fsevent (0.9.8) - rb-inotify (0.9.7) + rb-inotify (0.9.8) ffi (>= 0.5.0) - redcarpet (3.3.4) - rouge (2.0.6) - sass (3.4.22) + redcarpet (3.4.0) + rouge (2.0.7) + sass (3.4.23) sprockets (2.12.4) hike (~> 1.2) multi_json (~> 1.0) @@ -138,9 +132,12 @@ GEM sprockets-sass (1.3.1) sprockets (~> 2.0) tilt (~> 1.1) - thor (0.19.1) - thread_safe (0.3.5) + thor (0.19.4) + thread_safe (0.3.6) tilt (1.4.1) + turbolinks (5.0.1) + turbolinks-source (~> 5) + turbolinks-source (5.0.0) tzinfo (1.2.2) thread_safe (~> 0.1) uber (0.0.15) @@ -154,8 +151,7 @@ PLATFORMS ruby DEPENDENCIES - htmlbeautifier - middleman-hashicorp! + middleman-hashicorp (= 0.3.12) BUNDLED WITH - 1.13.6 + 1.14.6 diff --git a/website/Makefile b/website/Makefile index bdb362513..91a898c3a 100644 --- a/website/Makefile +++ b/website/Makefile @@ -1,22 +1,14 @@ -all: build +VERSION?="0.3.12" -init: - bundle +website: + @echo "==> Starting website in Docker..." + @docker run \ + --interactive \ + --rm \ + --tty \ + --publish "4567:4567" \ + --publish "35729:35729" \ + --volume "$(shell pwd):/website" \ + hashicorp/middleman-hashicorp:${VERSION} -docker-dev: - docker run -it --expose 4567 -p 4567:4567 -v "$(PWD)":/usr/src/app -w /usr/src/app ruby:2.3.1 \ - bash -c "apt-get update && apt-get -qy install curl git libgmp3-dev nodejs && \ - gem install bundler && bundle install && make dev" - -dev: init - PACKER_DISABLE_DOWNLOAD_FETCH=true PACKER_VERSION=1.0 bundle exec middleman server - -build: init - PACKER_DISABLE_DOWNLOAD_FETCH=true PACKER_VERSION=1.0 bundle exec middleman build - -format: - bundle exec htmlbeautifier -t 2 source/*.erb - bundle exec htmlbeautifier -t 2 source/layouts/*.erb - @pandoc -v > /dev/null || echo "pandoc must be installed in order to format markdown content" - pandoc -v > /dev/null && find . -iname "*.html.md" | xargs -I{} bash -c "pandoc -r markdown -w markdown --tab-stop=4 --atx-headers -s --columns=80 {} > {}.new"\; || true - pandoc -v > /dev/null && find . -iname "*.html.md" | xargs -I{} bash -c "mv {}.new {}"\; || true +.PHONY: website diff --git a/website/README.md b/website/README.md index e86ccc60e..64085fffc 100644 --- a/website/README.md +++ b/website/README.md @@ -1,33 +1,21 @@ -# Packer Website +# Vault Website -This subdirectory contains the entire source for the [Packer website](http://www.packer.io). -This is a [Middleman](http://middlemanapp.com) project, which builds a static -site from these source files. +This subdirectory contains the entire source for the [Packer Website][packer]. +This is a [Middleman][middleman] project, which builds a static site from these +source files. ## Contributions Welcome! If you find a typo or you feel like you can improve the HTML, CSS, or -JavaScript, we welcome contributions. Feel free to open issues or pull -requests like any normal GitHub project, and we'll merge it in. +JavaScript, we welcome contributions. Feel free to open issues or pull requests +like any normal GitHub project, and we'll merge it in. ## Running the Site Locally -Running the site locally is simple. Clone this repo and run the following -commands: +Running the site locally is simple. Clone this repo and run `make website`. -``` -make dev -``` +Then open up `http://localhost:4567`. Note that some URLs you may need to append +".html" to make them work (in the navigation). -Then open up `localhost:4567`. Note that some URLs you may need to append -".html" to make them work (in the navigation and such). - -## Keeping Tidy - -To keep the source code nicely formatted, there is a `make format` target. This -runs `htmlbeautify` and `pandoc` to reformat the source code so it's nicely formatted. - - make format - -Note that you will need to install pandoc yourself. `make format` will skip it -if you don't have it installed. \ No newline at end of file +[middleman]: https://www.middlemanapp.com +[vault]: https://www.packer.io diff --git a/website/Vagrantfile b/website/Vagrantfile deleted file mode 100644 index bd044c27f..000000000 --- a/website/Vagrantfile +++ /dev/null @@ -1,27 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -$script = < diff --git a/website/source/layouts/community.erb b/website/source/layouts/community.erb deleted file mode 100644 index 53dacbb4e..000000000 --- a/website/source/layouts/community.erb +++ /dev/null @@ -1,6 +0,0 @@ -<% wrap_layout :inner do %> - <% content_for :sidebar do %> -

- <% end %> - <%= yield %> -<% end %> diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index a2f17e297..289fafea4 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -1,118 +1,307 @@ <% wrap_layout :inner do %> <% content_for :sidebar do %> -

Docs

- - - - - - - - + <% end %> + <%= yield %> <% end %> diff --git a/website/source/layouts/docs_machine_readable.erb b/website/source/layouts/docs_machine_readable.erb deleted file mode 100644 index a19c42258..000000000 --- a/website/source/layouts/docs_machine_readable.erb +++ /dev/null @@ -1,16 +0,0 @@ -<% wrap_layout :inner do %> - <% content_for :sidebar do %> -

Docs

- - <% end %> - <%= yield %> -<% end %> diff --git a/website/source/layouts/downloads.erb b/website/source/layouts/downloads.erb new file mode 100644 index 000000000..0a4338808 --- /dev/null +++ b/website/source/layouts/downloads.erb @@ -0,0 +1,21 @@ +<% wrap_layout :inner do %> + <% content_for :sidebar do %> + + <% end %> + + <%= yield %> +<% end %> diff --git a/website/source/layouts/google-analytics.html b/website/source/layouts/google-analytics.html deleted file mode 100644 index a7cda0a63..000000000 --- a/website/source/layouts/google-analytics.html +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/website/source/layouts/guides.erb b/website/source/layouts/guides.erb new file mode 100644 index 000000000..7b1229af5 --- /dev/null +++ b/website/source/layouts/guides.erb @@ -0,0 +1,13 @@ +<% wrap_layout :inner do %> + <% content_for :sidebar do %> + + <% end %> + + <%= yield %> +<% end %> diff --git a/website/source/layouts/inner.erb b/website/source/layouts/inner.erb index 8d19dc812..c23296a98 100644 --- a/website/source/layouts/inner.erb +++ b/website/source/layouts/inner.erb @@ -1,27 +1,15 @@ <% wrap_layout :layout do %> -
- -
-
- <%= yield %> -
- <% if current_page.data.next_url %> - - <% end %> +
+
+
+ <%= yield_content :sidebar %> +
+ +
+
+ <%= yield %>
+
+
<% end %> diff --git a/website/source/layouts/intro.erb b/website/source/layouts/intro.erb index cea9a3403..c75077348 100644 --- a/website/source/layouts/intro.erb +++ b/website/source/layouts/intro.erb @@ -1,28 +1,46 @@ <% wrap_layout :inner do %> <% content_for :sidebar do %> -

Intro

- - + <% end %> + <%= yield %> <% end %> diff --git a/website/source/layouts/layout.erb b/website/source/layouts/layout.erb index 6ae7d7262..b5a34a5cd 100644 --- a/website/source/layouts/layout.erb +++ b/website/source/layouts/layout.erb @@ -1,126 +1,151 @@ - + - - <%= [current_page.data.page_title, "Packer by HashiCorp"].compact.join(" - ") %> - - + + + + + + "> + " sizes="32x32"> + " sizes="16x16"> + + " color="#5bbad5"> + + + + <%= title_for(current_page) %> + <%= stylesheet_link_tag "application" %> - - - - - - " type="image/x-icon"> - " type="image/x-icon"> + + + <%= javascript_include_tag "application" %> - - + - + + <%= yield_content :head %> - " class="page-<%= current_page.data.page_title ? "#{current_page.data.page_title} layout-#{current_page.data.layout} page-sub" : "home layout-#{current_page.data.layout}" %>"> - - - - <%= mega_nav :packer %> + - - <%= partial "layouts/sidebar" %> + <%= mega_nav :packer %> - <%= yield %> -
- - <%= javascript_include_tag "application" %> - <%= partial "layouts/google-analytics.html" %> - <%= partial "layouts/adroll.html" %> - <%= partial "layouts/structured_data.html" %> - + + <%= partial "layouts/sidebar" %> + + <%= yield %> + + + + + + + + + diff --git a/website/source/layouts/structured_data.html b/website/source/layouts/structured_data.html deleted file mode 100644 index c104f67f1..000000000 --- a/website/source/layouts/structured_data.html +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/website/source/layouts/svg/_svg-by-hashicorp.erb b/website/source/layouts/svg/_svg-by-hashicorp.erb deleted file mode 100644 index 607d16b1e..000000000 --- a/website/source/layouts/svg/_svg-by-hashicorp.erb +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/website/source/layouts/svg/_svg-download.erb b/website/source/layouts/svg/_svg-download.erb deleted file mode 100644 index 6d8441fea..000000000 --- a/website/source/layouts/svg/_svg-download.erb +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/website/source/layouts/svg/_svg-github.erb b/website/source/layouts/svg/_svg-github.erb deleted file mode 100644 index f0264d5aa..000000000 --- a/website/source/layouts/svg/_svg-github.erb +++ /dev/null @@ -1,9 +0,0 @@ - - - - diff --git a/website/source/layouts/svg/_svg-hashicorp-logo.erb b/website/source/layouts/svg/_svg-hashicorp-logo.erb deleted file mode 100644 index 60663e140..000000000 --- a/website/source/layouts/svg/_svg-hashicorp-logo.erb +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/website/source/microsoft-tile.xml.builder b/website/source/microsoft-tile.xml.builder new file mode 100644 index 000000000..4591abae3 --- /dev/null +++ b/website/source/microsoft-tile.xml.builder @@ -0,0 +1,14 @@ +--- +layout: false +noindex: true +--- + +xml.instruct! +xml.browserconfig do + xml.msapplication do + xml.tile do + xml.square150x150logo src: image_path("favicons/mstile-150x150.png") + xml.TileColor "#1D94DD" + end + end +end diff --git a/website/source/security.html.erb b/website/source/security.html.erb index cf08dfe56..d86fa77ff 100644 --- a/website/source/security.html.erb +++ b/website/source/security.html.erb @@ -1,8 +1,9 @@ --- page_title: "Security" -layout: community +layout: inner description: |- - Packer takes security very seriously. Please responsibly disclose any security vulnerabilities found and we'll handle it quickly. + Packer takes security very seriously. Please responsibly disclose any + security vulnerabilities found and we'll handle it quickly. ---

Packer Security

@@ -14,8 +15,8 @@ description: |-

- We deeply appreciate any effort to disclose vulnerabilities responsibly -

. + We deeply appreciate any effort to disclose vulnerabilities responsibly. +

If you would like to report a vulnerability, please see the Date: Sun, 26 Mar 2017 17:21:14 -0400 Subject: [PATCH 073/132] Update CSS breakpoints --- website/Gemfile | 2 +- website/Gemfile.lock | 6 +- website/Makefile | 2 +- website/packer.json | 2 +- .../source/assets/stylesheets/_community.scss | 26 +- website/source/assets/stylesheets/_docs.scss | 101 +-- .../source/assets/stylesheets/_downloads.scss | 96 +-- .../source/assets/stylesheets/_global.scss | 10 +- website/source/assets/stylesheets/_inner.scss | 89 +++ .../source/assets/stylesheets/_variables.scss | 10 +- .../assets/stylesheets/application.scss | 1 + website/source/layouts/docs.erb | 584 +++++++++--------- website/source/layouts/downloads.erb | 2 +- website/source/layouts/guides.erb | 12 +- website/source/layouts/inner.erb | 8 +- website/source/layouts/intro.erb | 76 ++- website/source/layouts/layout.erb | 2 +- 17 files changed, 506 insertions(+), 523 deletions(-) create mode 100644 website/source/assets/stylesheets/_inner.scss diff --git a/website/Gemfile b/website/Gemfile index 3a22f44c0..24926e6fd 100644 --- a/website/Gemfile +++ b/website/Gemfile @@ -1,3 +1,3 @@ source "https://rubygems.org" -gem "middleman-hashicorp", "0.3.17" +gem "middleman-hashicorp", "0.3.18" diff --git a/website/Gemfile.lock b/website/Gemfile.lock index 18c94e4b1..502823760 100644 --- a/website/Gemfile.lock +++ b/website/Gemfile.lock @@ -77,7 +77,7 @@ GEM rack (>= 1.4.5, < 2.0) thor (>= 0.15.2, < 2.0) tilt (~> 1.4.1, < 2.0) - middleman-hashicorp (0.3.17) + middleman-hashicorp (0.3.18) bootstrap-sass (~> 3.3) builder (~> 3.2) middleman (~> 3.4) @@ -138,7 +138,7 @@ GEM turbolinks (5.0.1) turbolinks-source (~> 5) turbolinks-source (5.0.0) - tzinfo (1.2.2) + tzinfo (1.2.3) thread_safe (~> 0.1) uber (0.0.15) uglifier (2.7.2) @@ -151,7 +151,7 @@ PLATFORMS ruby DEPENDENCIES - middleman-hashicorp (= 0.3.17) + middleman-hashicorp (= 0.3.18) BUNDLED WITH 1.14.6 diff --git a/website/Makefile b/website/Makefile index cc47b65c2..0a80966c7 100644 --- a/website/Makefile +++ b/website/Makefile @@ -1,4 +1,4 @@ -VERSION?="0.3.17" +VERSION?="0.3.18" website: @echo "==> Starting website in Docker..." diff --git a/website/packer.json b/website/packer.json index ca61b412f..ac5c88ad0 100644 --- a/website/packer.json +++ b/website/packer.json @@ -8,7 +8,7 @@ "builders": [ { "type": "docker", - "image": "hashicorp/middleman-hashicorp:0.3.17", + "image": "hashicorp/middleman-hashicorp:0.3.18", "discard": "true", "run_command": ["-d", "-i", "-t", "{{ .Image }}", "/bin/sh"] } diff --git a/website/source/assets/stylesheets/_community.scss b/website/source/assets/stylesheets/_community.scss index 11c985532..1ff047de6 100644 --- a/website/source/assets/stylesheets/_community.scss +++ b/website/source/assets/stylesheets/_community.scss @@ -1,16 +1,22 @@ -.people { - margin-top: 30px; +#inner { + .people { + margin-top: 30px; - .person { - margin-bottom: 40px; + .person { + &:after { + display: block; + clear: both; + content: ' '; + } - img { - width: 125px; - margin: auto auto; - } + img { + width: 125px; + margin: auto auto; + } - .bio { - padding-left: 150px; + .bio { + padding-left: 150px; + } } } } diff --git a/website/source/assets/stylesheets/_docs.scss b/website/source/assets/stylesheets/_docs.scss index 3a0aaa300..ccbbf2135 100644 --- a/website/source/assets/stylesheets/_docs.scss +++ b/website/source/assets/stylesheets/_docs.scss @@ -1,40 +1,4 @@ -// -// Docs -// -------------------------------------------------- - -$docs-font-size: 15px; - -body.layout-community, -body.layout-docs, -body.layout-downloads, -body.layout-guides, -body.layout-http, -body.layout-intro, -body.layout-inner { - *:focus { - outline: none; - } - - h1 > code, - h2 > code, - h3 > code, - h4 > code, - h5 > code - h6 > code, - li code, - table code, - p code, - tt, - .alert code { - font-family: $font-family-monospace; - font-size: 90%; - background-color: transparent; - color: inherit; - padding: 0; - } -} - -.docs-sidebar { +#docs-sidebar { margin-bottom: 30px; margin-top: 50px; @@ -109,66 +73,3 @@ body.layout-inner { } } } - -.bs-docs-section { - padding-left: 3%; - - p, li, .alert { - font-size: $docs-font-size; - font-family: $font-family-open-sans; - font-weight: $font-weight-reg; - line-height: 1.84em; - margin: 0 0 $docs-font-size; - -webkit-font-smoothing: antialiased; - } - - pre { - font-family: $font-family-monospace; - font-size: ($docs-font-size - 3); - font-weight: normal; - padding: 20px; - margin: 0 0 $docs-font-size; - - // This will force the code to scroll horizontally on small screens - // instead of wrapping. - code { - overflow-wrap: normal; - white-space: pre; - } - } - - a { - color: $body-link-color; - text-decoration: none; - - &:hover { - text-decoration: underline; - } - - code { - background: inherit; - color: $body-link-color; - } - } - - img { - max-width: 650px; - margin-top: 25px; - margin-bottom: 25px; - } - - h1, - h2, - h3, - h4 { - color: $body-font-color; - margin-top: 54px; - margin-bottom: $docs-font-size; - line-height: 1.3; - } - - h2 { - padding-bottom: 3px; - border-bottom: 1px solid $gray-light; - } -} diff --git a/website/source/assets/stylesheets/_downloads.scss b/website/source/assets/stylesheets/_downloads.scss index 1f374d2ad..155c44805 100644 --- a/website/source/assets/stylesheets/_downloads.scss +++ b/website/source/assets/stylesheets/_downloads.scss @@ -1,60 +1,64 @@ -.downloads { - margin-top: 20px; +body.layout-downloads { + #inner { + .downloads { + margin-top: 20px; - .description { - margin-bottom: 20px; - } - - .download { - border-bottom: 1px solid #b2b2b2; - padding-bottom: 15px; - margin-top: 10px; - margin-bottom: 10px; - - .details { - padding-left: 95px; - - h2 { - margin-top: 30px; + .description { + margin-bottom: 20px; } - ul { - padding-left: 0px; - margin-top: 8px; - } + .download { + border-bottom: 1px solid #b2b2b2; + padding-bottom: 15px; + margin-top: 10px; + margin-bottom: 10px; - li { - display: inline-block; + .details { + padding-left: 95px; - &:after { - content: " | "; + h2 { + margin-top: 30px; + } + + ul { + padding-left: 0px; + margin-top: 8px; + } + + li { + display: inline-block; + + &:after { + content: " | "; + } + + &:last-child:after { + content: ""; + } + } } - &:last-child:after { - content: ""; + .icon { + img { + width: 75px; + } + } + + .os-name { + font-size: 40px; + margin-bottom: -3px; } } - } - .icon { - img { - width: 75px; + .poweredby { + margin-top: 20px; + + img { + display: block; + margin: 0 auto; + width: 122px; + } } } - - .os-name { - font-size: 40px; - margin-bottom: -3px; - } - } - - .poweredby { - margin-top: 20px; - - img { - display: block; - margin: 0 auto; - width: 122px; - } } } diff --git a/website/source/assets/stylesheets/_global.scss b/website/source/assets/stylesheets/_global.scss index cafe5e394..07cfe6f02 100644 --- a/website/source/assets/stylesheets/_global.scss +++ b/website/source/assets/stylesheets/_global.scss @@ -25,15 +25,7 @@ h1 { margin-bottom: 24px; } -.center { - text-align: center; -} - -.alert p:last-child { - margin-bottom: 0; -} - -//Typekit utilites for hiding FOUC +// Avoid FOUT .wf-loading { visibility: hidden; } diff --git a/website/source/assets/stylesheets/_inner.scss b/website/source/assets/stylesheets/_inner.scss new file mode 100644 index 000000000..d20d71398 --- /dev/null +++ b/website/source/assets/stylesheets/_inner.scss @@ -0,0 +1,89 @@ +#inner { + p, li, .alert { + font-size: $font-size; + font-family: $font-family-open-sans; + font-weight: $font-weight-reg; + line-height: 1.84em; + margin: 0 0 $font-size; + -webkit-font-smoothing: antialiased; + } + + .alert p:last-child { + margin-bottom: 0; + } + + pre { + font-family: $font-family-monospace; + font-size: ($font-size - 3); + font-weight: normal; + padding: 20px; + margin: 0 0 $font-size; + + // This will force the code to scroll horizontally on small screens + // instead of wrapping. + code { + overflow-wrap: normal; + white-space: pre; + } + } + + a { + color: $body-link-color; + text-decoration: none; + + &:hover { + text-decoration: underline; + } + + code { + background: inherit; + color: $body-link-color; + } + } + + img { + display: block; + margin: 25px auto; + max-width: 650px; + height: auto; + width: 90%; + } + + h1, + h2, + h3, + h4 { + color: $body-font-color; + margin-top: 54px; + margin-bottom: $font-size; + line-height: 1.3; + } + + h2 { + padding-bottom: 3px; + border-bottom: 1px solid $gray-light; + } + + h1 > code, + h2 > code, + h3 > code, + h4 > code, + h5 > code + h6 > code, + li code, + table code, + p code, + tt, + .alert code { + font-family: $font-family-monospace; + font-size: 90%; + background-color: transparent; + color: inherit; + padding: 0; + } + + table { + @extend .table; + @extend .table-striped; + } +} diff --git a/website/source/assets/stylesheets/_variables.scss b/website/source/assets/stylesheets/_variables.scss index 6c144499d..c8419af0e 100644 --- a/website/source/assets/stylesheets/_variables.scss +++ b/website/source/assets/stylesheets/_variables.scss @@ -1,16 +1,14 @@ -// -// NEW STUFF -// --------------------- -// - // Colors $white: #FFFFFF; $black: #000000; +$gray-darker: #555555; $packer-blue: #1DAEFF; $packer-blue-dark: #1D94DD; $vagrant-blue: #1563FF; $vagrant-blue-dark: #104EB2; +$vault-black: #000000; +$vault-blue: #00ABE0; // Typography $font-family-klavika: 'klavika-web', 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif; @@ -37,7 +35,7 @@ $sidebar-font-weight: $font-weight-reg; $header-height: 92px; $header-font-size: $font-size - 2; $header-link-color: $body-font-color; -$header-link-color-hover: $packer-blue-dark; +$header-link-color-hover: $black; // Footer $footer-font-size: $font-size - 2; diff --git a/website/source/assets/stylesheets/application.scss b/website/source/assets/stylesheets/application.scss index 450bd2a82..6640956fe 100644 --- a/website/source/assets/stylesheets/application.scss +++ b/website/source/assets/stylesheets/application.scss @@ -22,6 +22,7 @@ @import '_header'; @import '_footer'; @import '_buttons'; +@import '_inner'; // Pages @import '_community'; diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index 289fafea4..45c92ed98 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -1,306 +1,304 @@ <% wrap_layout :inner do %> <% content_for :sidebar do %> -

+ > + Environment Variables + + > + Core Configuration + + > + Debugging + + <% end %> <%= yield %> diff --git a/website/source/layouts/downloads.erb b/website/source/layouts/downloads.erb index 0a4338808..9e9a79632 100644 --- a/website/source/layouts/downloads.erb +++ b/website/source/layouts/downloads.erb @@ -7,7 +7,7 @@ > - Download Community Tools + Community Tools
  • diff --git a/website/source/layouts/guides.erb b/website/source/layouts/guides.erb index 7b1229af5..f842f51a6 100644 --- a/website/source/layouts/guides.erb +++ b/website/source/layouts/guides.erb @@ -1,12 +1,10 @@ <% wrap_layout :inner do %> <% content_for :sidebar do %> - + <% end %> <%= yield %> diff --git a/website/source/layouts/inner.erb b/website/source/layouts/inner.erb index c23296a98..b1406f15f 100644 --- a/website/source/layouts/inner.erb +++ b/website/source/layouts/inner.erb @@ -1,14 +1,12 @@ <% wrap_layout :layout do %>
    -
    + -
    -
    - <%= yield %> -
    +
    + <%= yield %>
    diff --git a/website/source/layouts/intro.erb b/website/source/layouts/intro.erb index c75077348..1963d3f01 100644 --- a/website/source/layouts/intro.erb +++ b/website/source/layouts/intro.erb @@ -1,45 +1,43 @@ <% wrap_layout :inner do %> <% content_for :sidebar do %> - + > + Getting Started + +
  • + <% end %> <%= yield %> diff --git a/website/source/layouts/layout.erb b/website/source/layouts/layout.erb index b5a34a5cd..5ad2a4ad2 100644 --- a/website/source/layouts/layout.erb +++ b/website/source/layouts/layout.erb @@ -39,7 +39,7 @@ - <%= mega_nav :packer %> + <%= mega_nav :packer %>