Skip to content
Emmanuel Vadot edited this page Nov 18, 2020 · 13 revisions

Hooks should be installed to /usr/local/etc/poudriere.d/hooks/HOOKNAME.sh

Each hook is called with the following environment:

Name Description
BUILD_URL URL for the build.
BUILDNAME The configured build name.
LOG_URL URL for the logs.
POUDRIERE_BUILD_TYPE Currently always bulk
POUDRIERE_DATA Path to configured /usr/local/poudriere/data.
POUDRIERED Path to configured /usr/local/etc/poudriere.d.
JAILNAME The configured jail name.
PTNAME The configured ports tree name.
SETNAME The configured set name (from -z)
MASTERNAME Master Jail name, i.e. JAILNAME-PTNAME-SETNAME
MASTERMNT Path to the master reference jail. This is cloned for each builder.
PACKAGES Path to the packages directory for this build.

The following hooks currently exist:

Version Hook name Event Description Arguments
3.1.10 jail mount Called when jail mounts are performed. mntpath
3.1+ jail start Called when the master jail starts.
3.1+ jail stop Called when the master jail is stopped.
3.4+ jail pkgbase Called after the package base are created repopath
3.1.2 builder start Called when a builder jail is created. id mntpath
3.1.2 builder stop Called when a builder jail is stopped. id mntpath
3.1+ pkgbuild skipped Called for skipped port builds. origin pkgname dependent_origin
3.1+ pkgbuild ignored Called for ignored port builds. origin pkgname reason
3.1+ pkgbuild failed Called for failed port builds. port pkgname phase
3.1+ pkgbuild success Called for successful port builds. port pkgname
3.2+ pkgclean done Called when pkgclean is done. deleted_packages (0|1) built_repository (0|1)
3.2+ pkgrepo sign Called right before pkg-repo is called. PACKAGES PKG_REPO_SIGNING_KEY PKG_REPO_FROM_HOST PKG_REPO_META_FILE
3.1+ bulk start Called when bulk starts.
3.1+ bulk done Called when bulk stops. #built #failed #ignored #skipped
3.4+ ports_update done Called when ports -u stops.

The following hooks are mostly only for debugging Poudriere itself and are less useful in general:

Version Hook name Event Description Arguments
3.2+ gather_port_vars start Called when fetching ports metadata starts
3.2+ gather_port_vars stop Called when fetching ports metadata finishes
3.2+ compute_deps start Called when dep calculation starts
3.2+ compute_deps stop Called when dep calculation finishes
3.2+ delete_old_pkgs start Called when incremental build checks on existing packages starts
3.2+ delete_old_pkgs stop Called when incremental build checks on existing packages finishes
3.2+ start_builders start Called when builders begin populating/starting
3.2+ start_builders stop Called when builders are finished starting
3.2+ build_queue start Called at the start of building the package queue
3.2+ build_queue stop Called when the package queue is done building
Clone this wiki locally