Manually trigger builds

In addition to triggering a Jenkins build when a change is implemented in a Bitbucket repository, you can also trigger a Jenkins build manually from:

  • the Pull Request page.

  • the Source page.

Instead of triggering a build through an action, such as when committing a change to a branch, you can manually trigger a build from one of these locations without performing an action first.

The Trigger Builds feature is only displayed when the hook is enabled for that repository. If you do not see Trigger Builds on your repository’s Pull Request and Source pages, go to your hook settings for the repository and confirm the Enabled option is selected.

Trigger a build from the Source page

  1. In Bitbucket Cloud, go to your repository.

  2. In the left sidebar, click Source.

  3. On the right side of the page, click Webhook to Jenkins.

    wjbbc-trigger-build-source.png
  4. Click Trigger Builds. The Trigger Builds dialog opens.

    wjbbc-trigger-dialog.png

You can trigger a build from a repository branch or tag.

To trigger from a branch

  1. Select the Branch option.

  2. Click the dropdown and select the name of the branch from the list of available branches.

  3. Click Trigger.

To trigger from a tag

  1. Select the Tag option.

  2. Click the dropdown and select the name of the tag from the list of available tags.

  3. Click Trigger.

A success message is displayed when the trigger is successful, indicating the build was triggered. You can also go to your Jenkins instance. The Build History of the Jenkins job contains a record of the new successful build.

A Builds trigger failed message contains information regarding the error and suggestions for how to fix the issue.

A Builds partially triggered message is displayed if only part of the job is triggered. For example, not all branches were correctly configured in a multibranch job.

Trigger a build from the Pull Request page

  1. In Bitbucket Cloud, go to your repository.

  2. In the left sidebar, click Pull Request.

  3. From the Summary list, click the pull request you want to use to trigger a build.

  4. On the right side of the page, under Details, click Webhook to Jenkins.

  5. Click Trigger Builds.

A success message is displayed when the trigger is successful, indicating the build was triggered. You can also go to your Jenkins instance. The Build History of the Jenkins job contains a record of the new successful build.

A Builds trigger failed message contains information regarding the error and suggestions for how to fix the issue.

A Builds partially triggered message is displayed if only part of the job is triggered. For example, not all pull request parameters were correctly configured.

 

Â