github.com/hashicorp/packer@v1.14.3/website/content/docs/provisioners/breakpoint.mdx (about)

     1  ---
     2  description: >
     3    The `breakpoint` provisioner pauses a build until you press the Enter key. Use the `breakpoint` provisioner to help you debug errors.
     4  page_title: breakpoint provisioner reference
     5  ---
     6  
     7  <BadgesHeader>
     8    <PluginBadge type="official" />
     9  </BadgesHeader>
    10  
    11  # `breakpoint` provisioner
    12  
    13  The `breakpoint` provisioner pauses the build operation until you press the Enter key to resume the build. Use the `breakpoint` provisioner to help you debug errors.
    14  
    15  Alternatively, you can add the [`-debug` flag](/packer/docs/commands/build#debug) when running your build to halt the operation at every step and between every provisioner. 
    16  
    17  ## Basic Example
    18  
    19  <Tabs>
    20  <Tab heading="HCL2">
    21  
    22  ```hcl
    23  source "null" "example" {
    24    communicator = "none"
    25  }
    26  
    27  build {
    28    sources = ["source.null.example"]
    29  
    30    provisioner "shell-local" {
    31      inline = ["echo hi"]
    32    }
    33    provisioner "breakpoint" {
    34      disable = false
    35      note    = "this is a breakpoint"
    36    }
    37    provisioner "shell-local" {
    38      inline = ["echo hi 2"]
    39    }
    40  }
    41  ```
    42  
    43  </Tab>
    44  <Tab heading="JSON">
    45  
    46  ```json
    47  {
    48    "builders": [
    49      {
    50        "type": "null",
    51        "communicator": "none"
    52      }
    53    ],
    54    "provisioners": [
    55      {
    56        "type": "shell-local",
    57        "inline": "echo hi"
    58      },
    59      {
    60        "type": "breakpoint",
    61        "disable": false,
    62        "note": "this is a breakpoint"
    63      },
    64      {
    65        "type": "shell-local",
    66        "inline": "echo hi 2"
    67      }
    68    ]
    69  }
    70  ```
    71  
    72  </Tab>
    73  </Tabs>
    74  
    75  ## Configuration Reference
    76  
    77  ### Optional
    78  
    79  - `disable` (boolean) - If `true`, skip the breakpoint. Useful for when you
    80    have set multiple breakpoints and want to toggle them off or on. Default:
    81    `false`
    82  
    83  - `note` (string) - a string to include explaining the purpose or location of
    84    the breakpoint. For example, you may find it useful to number your
    85    breakpoints or label them with information about where in the build they
    86    occur
    87  
    88  @include 'provisioners/common-config.mdx'
    89  
    90  ## Usage
    91  
    92  Insert this provisioner wherever you want the build to pause. You'll see ui
    93  output prompting you to press "enter" to continue the build when you are ready.
    94  
    95  For example:
    96  
    97  ```shell-session
    98  ==> docker: Pausing at breakpoint provisioner with note "foo bar baz".
    99  ==> docker: Press enter to continue.
   100  ```
   101  
   102  Once you press enter, the build will resume and run normally until it either
   103  completes or errors.