Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dae12393c2 | |||
| 99aec637af | |||
| 10b4521265 | |||
| eda1a0393f | |||
| c958a3b827 | |||
| 6d9b40043d | |||
| ce3936df5b | |||
| aaff53c9d2 | |||
| edaefd12d2 | |||
| fef47cc1c9 | |||
| a86c299bcc | |||
| 009f8a6b8b | |||
| cc6a1e8303 | |||
| c6e2f3cf2f | |||
| 647b03f228 | |||
| c258bb2b5a | |||
| 6f1c0516d3 | |||
| 0bb9a1d08e | |||
| 030f0a54ba | |||
| 024418a10c | |||
| 68e0944be9 | |||
| f3b02a7913 | |||
| 755c0e634b | |||
| 158504e180 | |||
| f660b6d6cd | |||
| 2d266d2de2 | |||
| 62929162a9 | |||
| cbd80abfbf | |||
| 1cafc506d9 | |||
| 1653e5f226 | |||
| 1dcb45851a | |||
| 84d303f54e | |||
| a97df2b328 | |||
| 567ce48c3c | |||
| 376d13b4fb | |||
| e731b01d8a | |||
| 6a1c4e8280 | |||
| a6a5aaaeec | |||
| 1ce723de6a | |||
| 87b55db6bf |
+13
-2
@@ -1,4 +1,16 @@
|
||||
## (Unreleased)
|
||||
## 1.0rc1 (March 16, 2017)
|
||||
|
||||
### BUG FIXES:
|
||||
|
||||
* builder/googlecompute: Correct values for `on_host_maintenance`. [GH-4643]
|
||||
* builder/amazon: Fix crash in `step_region_copy`. [GH-4642]
|
||||
|
||||
### IMRPOVEMENTS:
|
||||
|
||||
* builder/amazon: validate ssh key name/file. [GH-4665]
|
||||
* builder/amazon: set force_deregister to true on -force. [GH-4649]
|
||||
* builder/hyper-v: validate output dir in step, not in config. [GH-4645]
|
||||
* website: fix display on ios devices. [GH-4618]
|
||||
|
||||
## 0.12.3 (March 1, 2017)
|
||||
|
||||
@@ -32,7 +44,6 @@
|
||||
* builder/azure:: add two new config variables for temp_compute_name and
|
||||
temp_resource_group_name. [GH-4468]
|
||||
|
||||
|
||||
### BUG FIXES:
|
||||
|
||||
* builder/amazon: Fix ssh agent authentication. [GH-4597]
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
[report-badge]: https://goreportcard.com/badge/github.com/mitchellh/packer
|
||||
[report]: https://goreportcard.com/report/github.com/mitchellh/packer
|
||||
|
||||
* Website: http://www.packer.io
|
||||
* Website: https://www.packer.io
|
||||
* IRC: `#packer-tool` on Freenode
|
||||
* Mailing list: [Google Groups](http://groups.google.com/group/packer-tool)
|
||||
|
||||
|
||||
@@ -78,6 +78,10 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if b.config.PackerConfig.PackerForce {
|
||||
b.config.AMIForceDeregister = true
|
||||
}
|
||||
|
||||
// Defaults
|
||||
if b.config.ChrootMounts == nil {
|
||||
b.config.ChrootMounts = make([][]string, 0)
|
||||
|
||||
@@ -75,6 +75,14 @@ func (c *RunConfig) Prepare(ctx *interpolate.Context) []error {
|
||||
|
||||
// Validation
|
||||
errs := c.Comm.Prepare(ctx)
|
||||
if c.SSHKeyPairName != "" {
|
||||
if c.Comm.Type == "winrm" && c.Comm.WinRMPassword == "" && c.Comm.SSHPrivateKey == "" {
|
||||
errs = append(errs, errors.New("A private_key_file must be provided to retrieve the winrm password when using ssh_keypair_name."))
|
||||
} else if c.Comm.SSHPrivateKey == "" && !c.Comm.SSHAgentAuth {
|
||||
errs = append(errs, errors.New("A private_key_file must be provided or ssh_agent_auth enabled when ssh_keypair_name is specified."))
|
||||
}
|
||||
}
|
||||
|
||||
if c.SourceAmi == "" && c.SourceAmiFilter.Empty() {
|
||||
errs = append(errs, errors.New("A source_ami or source_ami_filter must be specified"))
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,10 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if b.config.PackerConfig.PackerForce {
|
||||
b.config.AMIForceDeregister = true
|
||||
}
|
||||
|
||||
// Accumulate any errors
|
||||
var errs *packer.MultiError
|
||||
errs = packer.MultiErrorAppend(errs, b.config.AccessConfig.Prepare(&b.config.ctx)...)
|
||||
|
||||
@@ -58,6 +58,10 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if b.config.PackerConfig.PackerForce {
|
||||
b.config.AMIForceDeregister = true
|
||||
}
|
||||
|
||||
// Accumulate any errors
|
||||
var errs *packer.MultiError
|
||||
errs = packer.MultiErrorAppend(errs, b.config.AccessConfig.Prepare(&b.config.ctx)...)
|
||||
|
||||
@@ -77,6 +77,10 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if b.config.PackerConfig.PackerForce {
|
||||
b.config.AMIForceDeregister = true
|
||||
}
|
||||
|
||||
if b.config.BundleDestination == "" {
|
||||
b.config.BundleDestination = "/tmp"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ package common
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/mitchellh/packer/common"
|
||||
"github.com/mitchellh/packer/template/interpolate"
|
||||
"os"
|
||||
)
|
||||
|
||||
type OutputConfig struct {
|
||||
@@ -16,13 +16,5 @@ func (c *OutputConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig
|
||||
c.OutputDir = fmt.Sprintf("output-%s", pc.PackerBuildName)
|
||||
}
|
||||
|
||||
var errs []error
|
||||
if !pc.PackerForce {
|
||||
if _, err := os.Stat(c.OutputDir); err == nil {
|
||||
errs = append(errs, fmt.Errorf(
|
||||
"Output directory '%s' already exists. It must not exist.", c.OutputDir))
|
||||
}
|
||||
}
|
||||
|
||||
return errs
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"github.com/mitchellh/packer/common"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/mitchellh/packer/common"
|
||||
)
|
||||
|
||||
func TestOutputConfigPrepare(t *testing.T) {
|
||||
@@ -39,7 +40,7 @@ func TestOutputConfigPrepare_exists(t *testing.T) {
|
||||
PackerForce: false,
|
||||
}
|
||||
errs := c.Prepare(testConfigTemplate(t), pc)
|
||||
if len(errs) == 0 {
|
||||
t.Fatal("should have errors")
|
||||
if len(errs) != 0 {
|
||||
t.Fatal("should not have errors")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,16 +17,30 @@ import (
|
||||
type StepOutputDir struct {
|
||||
Force bool
|
||||
Path string
|
||||
|
||||
cleanup bool
|
||||
}
|
||||
|
||||
func (s *StepOutputDir) Run(state multistep.StateBag) multistep.StepAction {
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
|
||||
if _, err := os.Stat(s.Path); err == nil && s.Force {
|
||||
if _, err := os.Stat(s.Path); err == nil {
|
||||
if !s.Force {
|
||||
err := fmt.Errorf(
|
||||
"Output directory exists: %s\n\n"+
|
||||
"Use the force flag to delete it prior to building.",
|
||||
s.Path)
|
||||
state.Put("error", err)
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
ui.Say("Deleting previous output directory...")
|
||||
os.RemoveAll(s.Path)
|
||||
}
|
||||
|
||||
// Enable cleanup
|
||||
s.cleanup = true
|
||||
|
||||
// Create the directory
|
||||
if err := os.MkdirAll(s.Path, 0755); err != nil {
|
||||
state.Put("error", err)
|
||||
@@ -47,6 +61,10 @@ func (s *StepOutputDir) Run(state multistep.StateBag) multistep.StepAction {
|
||||
}
|
||||
|
||||
func (s *StepOutputDir) Cleanup(state multistep.StateBag) {
|
||||
if !s.cleanup {
|
||||
return
|
||||
}
|
||||
|
||||
_, cancelled := state.GetOk(multistep.StateCancelled)
|
||||
_, halted := state.GetOk(multistep.StateHalted)
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ func (c *VersionCommand) Run(args []string) int {
|
||||
var versionString bytes.Buffer
|
||||
fmt.Fprintf(&versionString, "Packer v%s", c.Version)
|
||||
if c.VersionPrerelease != "" {
|
||||
fmt.Fprintf(&versionString, ".%s", c.VersionPrerelease)
|
||||
fmt.Fprintf(&versionString, "-%s", c.VersionPrerelease)
|
||||
|
||||
if c.Revision != "" {
|
||||
fmt.Fprintf(&versionString, " (%s)", c.Revision)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ import (
|
||||
var GitCommit string
|
||||
|
||||
// The main version number that is being run at the moment.
|
||||
const Version = "1.0"
|
||||
const Version = "1.0.0"
|
||||
|
||||
// A pre-release marker for the version. If this is "" (empty string)
|
||||
// then it means that it is a final release. Otherwise, this is a pre-release
|
||||
@@ -20,7 +20,7 @@ func FormattedVersion() string {
|
||||
var versionString bytes.Buffer
|
||||
fmt.Fprintf(&versionString, "%s", Version)
|
||||
if VersionPrerelease != "" {
|
||||
fmt.Fprintf(&versionString, ".%s", VersionPrerelease)
|
||||
fmt.Fprintf(&versionString, "-%s", VersionPrerelease)
|
||||
|
||||
if GitCommit != "" {
|
||||
fmt.Fprintf(&versionString, " (%s)", GitCommit)
|
||||
|
||||
+1
-4
@@ -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.13"
|
||||
|
||||
+29
-33
@@ -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.13)
|
||||
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.13)
|
||||
|
||||
BUNDLED WITH
|
||||
1.13.6
|
||||
1.14.6
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# Proprietary License
|
||||
|
||||
This license is temporary while a more official one is drafted. However,
|
||||
this should make it clear:
|
||||
|
||||
The text contents of this website are MPL 2.0 licensed.
|
||||
|
||||
The design contents of this website are proprietary and may not be reproduced
|
||||
or reused in any way other than to run the website locally. The license for
|
||||
the design is owned solely by HashiCorp, Inc.
|
||||
+12
-20
@@ -1,22 +1,14 @@
|
||||
all: build
|
||||
VERSION?="0.3.13"
|
||||
|
||||
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
|
||||
|
||||
+10
-22
@@ -1,33 +1,21 @@
|
||||
# Packer 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.
|
||||
[middleman]: https://www.middlemanapp.com
|
||||
[packer]: https://www.packer.io
|
||||
|
||||
Vendored
-27
@@ -1,27 +0,0 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
$script = <<SCRIPT
|
||||
sudo apt-get -y update
|
||||
|
||||
# RVM/Ruby
|
||||
sudo apt-get -qy install curl git libgmp3-dev nodejs
|
||||
gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
|
||||
# Install rvm and the latest version of ruby
|
||||
curl -sSL https://get.rvm.io | bash -s stable
|
||||
. ~/.bashrc
|
||||
. ~/.bash_profile
|
||||
rvm install ruby-2.3.1
|
||||
gem install bundler
|
||||
|
||||
# Middleman deps
|
||||
cd /vagrant
|
||||
make dev
|
||||
SCRIPT
|
||||
|
||||
Vagrant.configure(2) do |config|
|
||||
config.vm.box = "bento/ubuntu-14.04"
|
||||
config.vm.network "private_network", ip: "33.33.30.10"
|
||||
config.vm.provision "shell", inline: $script, privileged: false
|
||||
config.vm.synced_folder ".", "/vagrant", type: "rsync"
|
||||
end
|
||||
@@ -1,38 +0,0 @@
|
||||
require "rack"
|
||||
require "rack/contrib/not_found"
|
||||
require "rack/contrib/response_headers"
|
||||
require "rack/contrib/static_cache"
|
||||
require "rack/contrib/try_static"
|
||||
require "rack/protection"
|
||||
|
||||
# Protect against various bad things
|
||||
use Rack::Protection::JsonCsrf
|
||||
use Rack::Protection::RemoteReferrer
|
||||
use Rack::Protection::HttpOrigin
|
||||
use Rack::Protection::EscapedParams
|
||||
use Rack::Protection::XSSHeader
|
||||
use Rack::Protection::FrameOptions
|
||||
use Rack::Protection::PathTraversal
|
||||
use Rack::Protection::IPSpoofing
|
||||
|
||||
# Properly compress the output if the client can handle it.
|
||||
use Rack::Deflater
|
||||
|
||||
# Set the "forever expire" cache headers for these static assets. Since
|
||||
# we hash the contents of the assets to determine filenames, this is safe
|
||||
# to do.
|
||||
use Rack::StaticCache,
|
||||
:root => "build",
|
||||
:urls => ["/assets", "/javascripts"],
|
||||
:duration => 2,
|
||||
:versioning => false
|
||||
|
||||
# Try to find a static file that matches our request, since Middleman
|
||||
# statically generates everything.
|
||||
use Rack::TryStatic,
|
||||
:root => "build",
|
||||
:urls => ["/"],
|
||||
:try => [".html", "index.html", "/index.html"]
|
||||
|
||||
# 404 if we reached this point. Sad times.
|
||||
run Rack::NotFound.new(File.expand_path("../build/404.html", __FILE__))
|
||||
+6
-12
@@ -8,15 +8,16 @@
|
||||
"builders": [
|
||||
{
|
||||
"type": "docker",
|
||||
"image": "ruby:2.3-slim",
|
||||
"commit": "true"
|
||||
"image": "hashicorp/middleman-hashicorp:0.3.13",
|
||||
"discard": "true",
|
||||
"run_command": ["-d", "-i", "-t", "{{ .Image }}", "/bin/sh"]
|
||||
}
|
||||
],
|
||||
"provisioners": [
|
||||
{
|
||||
"type": "file",
|
||||
"source": ".",
|
||||
"destination": "/app"
|
||||
"destination": "/website"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
@@ -27,16 +28,9 @@
|
||||
"FASTLY_API_KEY={{ user `fastly_api_key` }}"
|
||||
],
|
||||
"inline": [
|
||||
"apt-get -qq update",
|
||||
"apt-get -yqq install build-essential curl git libffi-dev wget nodejs",
|
||||
"apt-get -yqq install python-pip",
|
||||
"pip install s3cmd",
|
||||
"cd /app",
|
||||
|
||||
"bundle check || bundle install --jobs 7",
|
||||
"bundle check || bundle install",
|
||||
"bundle exec middleman build",
|
||||
|
||||
"/bin/bash ./scripts/deploy.sh"
|
||||
"/bin/sh ./scripts/deploy.sh"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -93,7 +93,7 @@ if [ -z "$NO_UPLOAD" ]; then
|
||||
modify "s3://hc-sites/$PROJECT/latest/"
|
||||
fi
|
||||
|
||||
# Perform a purge of the surrogate key.
|
||||
# Perform a soft-purge of the surrogate key.
|
||||
if [ -z "$NO_PURGE" ]; then
|
||||
echo "Purging Fastly cache..."
|
||||
curl \
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
//= require jquery
|
||||
//= require bootstrap
|
||||
|
||||
//= require lib/Base
|
||||
|
||||
//= require hashicorp/mega-nav
|
||||
|
||||
//= require docs
|
||||
//= require app/Sidebar
|
||||
////= require app/Init
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#sidebar-docs,
|
||||
.docs-body{
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -95,10 +95,6 @@ p {
|
||||
color: darken($green, 50%);
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
@import url("//fonts.googleapis.com/css?family=Inconsolata|Open+Sans:300,400,600");
|
||||
|
||||
// Mega Nav
|
||||
@import 'hashicorp/mega-nav';
|
||||
|
||||
@import "_helpers";
|
||||
@import "_reset";
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ each category, the available configuration keys are alphabetized.
|
||||
volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic
|
||||
volumes
|
||||
|
||||
- `root_device_name` (string) - The root device name. For example, `xvda`.
|
||||
- `root_device_name` (string) - The root device name. For example, `xvda`.
|
||||
|
||||
- `mount_path` (string) - The path where the volume will be mounted. This is
|
||||
where the chroot environment will be. This defaults to
|
||||
|
||||
@@ -49,15 +49,15 @@ builder.
|
||||
- `source_ami` (string) - The initial AMI used as a base for the newly
|
||||
created machine. `source_ami_filter` may be used instead to populate this
|
||||
automatically.
|
||||
|
||||
|
||||
- `ami_root_device` (block device mapping) - A block device mapping describing
|
||||
the root device of the AMI. This looks like the mappings in `ami_block_device_mapping`,
|
||||
except with an additional field:
|
||||
|
||||
- `source_device_name` (string) - The device name of the block device on the
|
||||
source instance to be used as the root device for the AMI. This must correspond
|
||||
to a block device in `launch_block_device_mapping`.
|
||||
|
||||
|
||||
- `source_device_name` (string) - The device name of the block device on the
|
||||
source instance to be used as the root device for the AMI. This must correspond
|
||||
to a block device in `launch_block_device_mapping`.
|
||||
|
||||
### Optional:
|
||||
|
||||
- `ami_block_device_mappings` (array of block device mappings) - Add one or
|
||||
|
||||
@@ -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**.
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -177,15 +180,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`.
|
||||
|
||||
@@ -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 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`.
|
||||
|
||||
- `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:
|
||||
- `<waitXX> ` - Add user defined time.Duration pause before sending any
|
||||
additional keys. For example `<wait10m>` or `<wait1m20s>`
|
||||
|
||||
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 `<leftCtrlOn>c<leftCtrlOff>`.
|
||||
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
|
||||
`<leftCtrlOn>c<leftCtrlOff>`.
|
||||
|
||||
In addition to the special keys, each command to type is treated as a
|
||||
[configuration template](/docs/templates/configuration-templates.html). The
|
||||
|
||||
@@ -8,6 +8,7 @@ description: |
|
||||
Triton "VM to image" functionality to create a reusable image and finally
|
||||
destroys the temporary VM. This reusable image can then be used to launch new
|
||||
VM's.
|
||||
layout: docs
|
||||
page_title: Triton Builder
|
||||
...
|
||||
|
||||
|
||||
@@ -46,13 +46,6 @@ The configuration allows you to specify and access the artifact in Atlas.
|
||||
|
||||
### Required:
|
||||
|
||||
- `token` (string) - Your access token for the Atlas API.
|
||||
|
||||
-> Login to Atlas to [generate an Atlas
|
||||
Token](https://atlas.hashicorp.com/settings/tokens). The most convenient way to
|
||||
configure your token is to set it to the `ATLAS_TOKEN` environment variable, but
|
||||
you can also use `token` configuration option.
|
||||
|
||||
- `artifact` (string) - The shorthand tag for your artifact that maps to
|
||||
Atlas, i.e `hashicorp/foobar` for `atlas.hashicorp.com/hashicorp/foobar`.
|
||||
You must have access to the organization—hashicorp in this example—in order
|
||||
@@ -69,6 +62,13 @@ you can also use `token` configuration option.
|
||||
|
||||
### Optional:
|
||||
|
||||
- `token` (string) - Your access token for the Atlas API.
|
||||
|
||||
-> Login to Atlas to [generate an Atlas
|
||||
Token](https://atlas.hashicorp.com/settings/tokens). The most convenient way to
|
||||
configure your token is to set it to the `ATLAS_TOKEN` environment variable, but
|
||||
you can also use `token` configuration option.
|
||||
|
||||
- `atlas_url` (string) - Override the base URL for Atlas. This is useful if
|
||||
you're using Atlas Enterprise in your own network. Defaults to
|
||||
`https://atlas.hashicorp.com/api/v1`.
|
||||
|
||||
@@ -54,7 +54,11 @@ know.
|
||||
|
||||
First, the destination directory must already exist. If you need to create it,
|
||||
use a shell provisioner just prior to the file provisioner in order to create
|
||||
the directory.
|
||||
the directory. If the destination directory does not exist, the file
|
||||
provisioner may succeed, but it will have undefined results. Note that the
|
||||
`docker` builder does not have this requirement. It will create any needed
|
||||
destination directories, but it's generally best practice to not rely on this
|
||||
behavior.
|
||||
|
||||
Next, the existence of a trailing slash on the source path will determine
|
||||
whether the directory name will be embedded within the destination, or whether
|
||||
@@ -91,20 +95,21 @@ lrwxr-xr-x 1 mwhooker staff 5 Jan 27 17:10 file1link -> file1
|
||||
|
||||
```json
|
||||
"provisioners": [
|
||||
{
|
||||
"type": "shell-local",
|
||||
"command": "mkdir -p toupload; tar cf toupload/files.tar files"
|
||||
},
|
||||
{
|
||||
"destination": "/tmp/",
|
||||
"source": "./toupload",
|
||||
"type": "file"
|
||||
},
|
||||
{
|
||||
"inline": [
|
||||
"cd /tmp && tar xf toupload/files.tar",
|
||||
],
|
||||
"type": "shell"
|
||||
}
|
||||
{
|
||||
"type": "shell-local",
|
||||
"command": "mkdir -p toupload; tar cf toupload/files.tar files"
|
||||
},
|
||||
{
|
||||
"destination": "/tmp/",
|
||||
"source": "./toupload",
|
||||
"type": "file"
|
||||
},
|
||||
{
|
||||
"inline": [
|
||||
"cd /tmp && tar xf toupload/files.tar",
|
||||
"rm toupload/files.tar"
|
||||
],
|
||||
"type": "shell"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -34,12 +34,14 @@
|
||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NR2SD7C"
|
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->
|
||||
|
||||
<%= mega_nav :packer %>
|
||||
|
||||
<div id="header" class="navigation white <%= current_page.data.page_title == "home" ? "" : "navbar-static-top" %>">
|
||||
<div class="container-fluid">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<div class="navbar-brand">
|
||||
<a class="logo" href="/">Packer</a>
|
||||
<a class="by-hashicorp white" href="https://www.hashicorp.com/"><span class="svg-wrap">by</span><%= partial "layouts/svg/svg-by-hashicorp" %><%= partial "layouts/svg/svg-hashicorp-logo" %>Hashicorp</a>
|
||||
</div>
|
||||
<button class="navbar-toggle white" type="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
@@ -72,7 +74,7 @@
|
||||
<%= yield %>
|
||||
<div class="clearfix"></div>
|
||||
<footer id="footer" class="navigation white">
|
||||
<div class="container-fluid">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<% # current_page.path does not have an extension, but
|
||||
|
||||
Reference in New Issue
Block a user