Skip to content

Hooks & env vars ​

Hooks are executable scripts in .yoho/hooks/<name> (or hooks.path), run on your machine. A missing hook is skipped, a non-executable one warns, a non-zero exit aborts the command. yoho init writes samples.

HookWhen
docker-setupduring yoho setup, Docker install
pre-connectbefore connecting to Servers
pre-buildbefore building images
pre-deploybefore the cutover
post-deployafter a successful deploy
pre-app-boot, post-app-bootaround starting new containers
pre-proxy-reboot, post-proxy-rebootaround Proxy (re)boot
pre-backup, post-backuparound a Backup
pre-restore, post-restorearound a restore
pre-cutoverafter the migration cutover preflight, before the old containers stop (migrate)
post-cutoverafter the migration cutover is done

Hook environment ​

YOHO_APP, YOHO_DESTINATION, YOHO_VERSION, YOHO_SERVICE_VERSION (<app>@<version>), YOHO_HOSTS (comma-separated), YOHO_COMMAND, YOHO_SUBCOMMAND, YOHO_PERFORMER, YOHO_RECORDED_AT (UTC RFC3339), YOHO_LOCK, YOHO_RUNTIME (seconds, post-deploy only), YOHO_CUTOVER (the cutover id, pre-cutover and post-cutover). Backup and restore hooks add YOHO_BACKUP_JOB, YOHO_BACKUP_TARGET and YOHO_BACKUP_ID (post-backup, pre-restore, post-restore).

Secrets are never injected into hooks.

Container environment ​

Injected into compiled Services unless the compose file sets them: YOHO_APP, YOHO_DESTINATION, YOHO_SERVER, YOHO_SERVICE, and YOHO_VERSION (only on Services whose image is tagged with the Version, so third-party images are not recreated each deploy). Services also carry labels yoho.app, yoho.destination, yoho.service, yoho.version.