What are Build Event Handlers
Build Event Handlers are tasks which execute on the server (as opposed to Actions which run on the agents). They can be configured to respond to one or more of Build Events which occur as the following build eventsprogresses.
Build event | When triggered |
---|---|
On Build Created | When a new build is initialised, after checking repositories, associating changesets and creating workspace folder, but before stages are initialised and build is queued. |
On Before Build Queued | Before a new build is added to the build queue, after initialising build and stages, but before configuration conditions are checked. |
On Before Build Start | Before a build is started, once conditions are checked and build is removed from queue . |
On After Build Started | After build is started, build version allocated and repository cache is updated to the latest revision. |
On Before Stage Start | Before a specified stage is started, after license has been allocated and agent reserved. |
On Sending Stage To Agent | Before stage is sent to an agent for execution, after checking agent is online and setting up build log. |
On Stage Completed | Once stage has completed and has not been stopped, after updating any unit test metrics. |
On Build Pending Promotion | When build is paused pending promotion to the next stage |
On Before Build Continue | When build is paused pending promotion to the next stage |
On After Build Continued | Before a build is continues after promotion, once conditions are checked and build is removed from queue. |
On Build Stopping | When build stop has been requested either manually by a user or by a Stop action. |
On Build Completed | When build has completed, either successfully or on failure, after build statistics are updated and workspace cleaned up. |
Build Event Handlers can be created on the Events step of the Configuration Wizard. The following types are currently available:
- Octopus Deploy
- Tag Repository Changeset
- Update GitHub Status
The following Event Handler types are available:
- Octopus Deploy
- Tag Repository Changeset
- Update GitHub Status
- GitHub Release
- Update Bitbucket Server Build Status
- HTTP Request
How to Create an Event Handler
Build Event Handlers can be created within the Events step of the Configuration Wizard.
Build Event Handler
Event Handler Name
Friendly name for the event handler (this will be visible in the 'Events' section of the website)
Run Order
The order in which the event handler will be run (relevant in the situation where multiple event handlers are present).
Enabled
Whether this event handler will be run or not. Disabling event handlers can be useful when setting up a build process.
Type
The type of event handler to be used.
Conditions
The conditions which must all evaluate as true before the build event handler is executed.
...