I want to know if it is possible to configure something similar to what is accomplished by Jenkins+Github with the request builder plugin. Specifically, triggering a build on Bamboo when a pull request is created on Stash, using the pull request branch for the build.
Bonus points for triggering new builds when the pull request is updated, or if some command is given through comments (like with the Jenkins plugin).
I can't see a way to do that, and I can't even see a way to create a plugin that will make it possible. Maybe the Merge-checks trigger for plugins would work, but it looks like something triggered when someone goes look at the pull request, not something triggered when a pull request arrives.
To configure Bamboo to trigger a build on code check-in:From the Bamboo dashboard select Builds > All build plans. Locate the plan in the list and select the edit icon ( ) to display the plan's configuration pages. Select the Triggers tab, then Add trigger. Select Remote trigger.
Repository triggers the build when changes are committed.
To review a pull request, select either Approve or Needs work within the header of a pull request. Click the button again or click a different one to change your status. Approving a pull request lets the author know you reviewed their changes and that you feel the work can be merged with the target branch.
We solved this by writing a Stash plugin, which has now been open sourced and is available on github.
The trick is to annotate methods with com.atlassian.event.api.EventListener
, which will get Stash to call them when a corresponding event happens. Then just listen to events such as:
com.atlassian.stash.event.pull.PullRequestCommentAddedEvent
com.atlassian.stash.event.pull.PullRequestOpenedEvent
com.atlassian.stash.event.pull.PullRequestReopenedEvent
com.atlassian.stash.event.pull.PullRequestRescopedEvent
Aside from that, just follow Atlassian guidelines to create plugins. The open sourced plugin can serve as a reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With