• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Waypoint
  • Install
  • Tutorials
  • Documentation
  • CLI
  • Plugins
  • Try Cloud(opens in new tab)
  • Sign up
Waypoint Home

Documentation

Skip to main contentOverview
  • Getting Started


    • Overview
    • app
    • build
    • config
    • deploy
    • hook
    • plugin
    • registry
    • release
    • runner
    • url
    • use
    • variable
  • URL Service
  • Logs
  • Exec
  • Workspaces
  • Plugins
  • Triggers

  • Troubleshooting
  • Glossary

  • Roadmap

  • Resources

  • Tutorial Library
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  1. Developer
  2. Waypoint
  3. Documentation
  4. waypoint.hcl
  5. hook
  • Waypoint
  • v0.9.x
  • v0.8.x
  • v0.7.x
  • v0.6.x
  • v0.5.x
  • v0.4.x
  • v0.3.x
  • v0.2.x
  • v0.1.x

ยปhook Stanza

Placementapp -> build -> hook
app -> build -> registry -> hook
app -> deploy -> hook
app -> release -> hook

The hook stanza configures hooks that are executed before or after operations. This can be useful to do things such as perform a security scan on an image, run database migrations on a deploy, etc.

Multiple hook stanzas can be specified. This will execute multiple hooks for an operation. The behavior with multiple hooks is documented on the hooks lifecycle page.

app "frontend" {
  build {
    # ...

    hook {
      when    = "before"
      command = ["./validate-creds.sh"]
    }
  }

  # ...
}

hook Parameters

Required

  • when (string) - When the hook should be executed. Either "before" or "after".

  • command (array<string>) - The command to execute. The first element of the list is the command to execute and each remainder is an argument. By specifying this as a list of strings, you do not need to worry about escaping arguments.

Optional

  • on_failure (string: "fail") - Behavior when the hook fails. If this is "continue" then failures are ignored. Otherwise, a failure cases the entire operation to fail. See failure behavior.
Edit this page on GitHub

On this page

  1. hook Stanza
  2. hook Parameters
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)