You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

The 'Update Stash Build Status Build Event Handler' is an event handler which interacts with the Bitbucket Server (previously Stash) Build Integration REST API.  This feature allows Continua CI to mark commits within a BitBucket Server repository with a build state of successful, failed, or "in progress". 

The event handler is set to automatically respond to the following Build Events:

  • On Before Stage Start
  • On Build Pending Promotion
  • On Stage Completed
  • On Build Stopping
  • On Build Completed

The Pending status is sent when the On Before Stage Start event is triggered for a specified stage. 

The Success status is sent when the On Stage Completed event is triggered for a specified stage, or optionally when the On Build Pending Promotion event fires - whichever is first.

The Failure status is sent when the On Stage Completed event is triggered for a specified stage or On Build Stopping, On Build Completed events are triggered and the build has failed. 

Example use case

This event handler works fantastically as a pre-step within a pull request pipeline.  ContinuaCI can be configured to automatically pull the request, build it, test it, and report back its status.

How to create an update Stash Build Status Build Event Handler

  1. Navigate to the events tab within the desired Build Configuration
  2. Click the 'Create' link within the 'Build Event Handlers' section

Select an Event Handler

  1. Enter the name of the event handler (in this case 'Update Stash Build Status')
  2. Enter the sequence in which you wish this event handler to be run.  In our case this is the first event handler so we will leave the default of 1
  3. From the type dropdown select 'Update Stash Build Status'

Select 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 specific event handler is able to be run

Type

The type of event handler (Octopus Deploy, Tag Repository Changeset, Update GitHub Status. Update Stash Build Status) 

Update GitHub Status

  1. Enter the BitBucket Server API URL.

  2. Enter your BitBucket Server Username / Password or  Access Token.
  3. Enter the name of the Continua CI repositories that you wish to consider when updating status (these can be found on the 'repositories' page).


    Stash Url

    The URL of the Bitbucket Server API endpoint to be used (more specific details on this can be found: here).

    Username

    The  Bitbucket Server Username used to login (this user should have access to the repository in question).

    Password

    The  Bitbucket Server Password used to login (passwords should not contain any of the following characters: !:@).

    Access Token

    The Access Token used to submit information to  Bitbucket Server (A detailed explanation on how to create and maintain an access token can be found within the github documentation).

    Repositories

    A comma separated list of repository names to apply this status information to.

When To Run

  1. Enter the stage timings when this event handler should be run.


    Start Stage 

    The stage for the On Before Stage Start event when the 'Pending Comment' text will be sent 

    End Stage 

    The stage for the On Stage Completed event when the 'Success Comment' or 'Failure Comment' text will be sent 

    Complete on Waiting Promotion

    If any stage is awaiting promotion, send the Success or Failure Comment on the On Build Pending Promotion event

Comments

  1. Enter the comments that you wish to send to GitHub


    Pending Comment

    The text of the comment that will be sent when the build hits the 'On Before Stage Start' event for the specified stage.

    Failure Comment

    The text of the comment that will be sent when build hits the 'On Stage Completed' event for the specified stage, and the build has failed.

    Success Comment

    The text of the comment that will be sent when build hits the 'On Stage Completed' event for the specified stage, and the build has succeeded.

Comments

  1. Select the build options for this event handler


    Wait for Results

    Should the event handler wait for the result before proceeding. Unchecking this option will run the Event Handler in a separate thread.  

    Fail Build on Error

    Whether or not to Fail the build if this event handler fails.

    Log Build Messages

    Whether or not logs for this event handler will be displayed in the build log.

 

  • No labels