diff --git a/provisioner/breakpoint/provisioner.go b/provisioner/breakpoint/provisioner.go index 05428383d..4f213f7dd 100644 --- a/provisioner/breakpoint/provisioner.go +++ b/provisioner/breakpoint/provisioner.go @@ -14,8 +14,8 @@ import ( type Config struct { common.PackerConfig `mapstructure:",squash"` - // The local path of the file to upload. - Note string `mapstructure:"note"` + Note string `mapstructure:"note"` + Disable bool `mapstructure:"disable"` ctx interpolate.Context } @@ -40,6 +40,17 @@ func (p *Provisioner) Prepare(raws ...interface{}) error { } func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error { + if p.config.Disable { + if p.config.Note != "" { + ui.Say(fmt.Sprintf( + "Breakpoint provisioner with note \"%s\" disabled; continuing...", + p.config.Note)) + } else { + ui.Say("Breakpoint provisioner disabled; continuing...") + } + + return nil + } if p.config.Note != "" { ui.Say(fmt.Sprintf("Pausing at breakpoint provisioner with note \"%s\".", p.config.Note)) } else { diff --git a/website/source/docs/provisioners/breakpoint.html.md b/website/source/docs/provisioners/breakpoint.html.md index 536768edb..edcc48405 100644 --- a/website/source/docs/provisioners/breakpoint.html.md +++ b/website/source/docs/provisioners/breakpoint.html.md @@ -8,15 +8,16 @@ page_title: 'breakpoint - Provisioners' sidebar_current: 'docs-provisioners-breakpoint' --- -# File Provisioner +# Breakpoint Provisioner Type: `breakpoint` The breakpoint provisioner will pause until the user presses "enter" to resume the build. This is intended for debugging purposes, and allows you -to halt at a particular part of the provisioning process, rather than using the -`-debug` flag, which will instead halt at every step and between every -provisioner. +to halt at a particular part of the provisioning process. + +This is independent of the `-debug` flag, which will instead halt at every step +and between every provisioner. ## Basic Example @@ -31,7 +32,26 @@ provisioner. ### Optional +- `disable` (boolean) - If `true`, skip the breakpoint. Useful for when you + have set multiple breakpoints and want to toggle them off or on. + Default: `false` + - `note` (string) - a string to include explaining the purpose or location of the breakpoint. For example, you may find it useful to number your breakpoints or label them with information about where in the build they - occur \ No newline at end of file + occur + +## Usage + +Insert this provisioner wherever you want the build to pause. You'll see ui +output prompting you to press "enter" to continue the build when you are ready. + +For example: + +``` +==> docker: Pausing at breakpoint provisioner with note "foo bar baz". +==> docker: Press enter to continue. +``` + +Once you press enter, the build will resume and run normally until it either +completes or errors. \ No newline at end of file diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index eb400223b..5a9f4436d 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -201,6 +201,9 @@ > Ansible Remote + > + Breakpoint + > Chef Client