buidl

Reference

Hooks

Executables in .buidl/hooks. Each one gets the release identity and every resolved secret.

HookWhenFailure aborts the deploy?
pre-buildbefore the image is builtyes
post-buildafter the image is pushed (BUIDL_DIGEST set)yes
pre-deployafter preflight, before applyyes
post-deployafter the release is healthyno
deploy-failedafter a failed deployno

pre-deploy is the usual place for migrations: the image exists, nothing is serving yet, and the hook can use a credential the app never sees.

Hooks also get BUIDL_APP, BUIDL_ENV, BUIDL_RELEASE, BUIDL_DIGEST, BUIDL_IMAGE, BUIDL_NAMESPACE, BUIDL_GIT_SHA, BUIDL_GIT_BRANCH, BUIDL_ACTOR, BUIDL_URL, BUIDL_VERSION, and BUIDL_HOOK=1. A hook that exists but is not executable is reported, not skipped. buidl hooks lists what is enabled.

.buidl/hooks/
  pre-deploy            executable
  pre-deploy.sample     inert until you chmod +x