Skip to content

Latest commit

 

History

History
182 lines (119 loc) · 7.04 KB

hooks.rst

File metadata and controls

182 lines (119 loc) · 7.04 KB

Hooks

Hooks enable you to execute custom code at certain points during a BundleWrap run. This is useful for integrating with other systems e.g. for team notifications, logging or statistics.

To use hooks, you need to create a subdirectory in your repo called hooks. In that directory you can place an arbitrary number of Python source files. If those source files define certain functions, these functions will be called at the appropriate time.

Example

hooks/my_awesome_notification.py:

from my_awesome_notification_system import post_message

def node_apply_start(repo, node, interactive=False, **kwargs):
    post_message("Starting apply on {}, everything is gonna be OK!".format(node.name))

Note

Always define your hooks with **kwargs so we can pass in more information in future updates without breaking your hook.

Functions

This is a list of all functions a hook file may implement.

|

|

|

|

|

|

|

|

|

|

|