Skip to content

By using this event you can release your pull-request in bitbucket repository

License

Notifications You must be signed in to change notification settings

sharovik/bitbucket-release-event

Repository files navigation

BitBucket Release event

The event can merge one or multiple pull-requests into main branch of the repository, to which that pull-request related. This is event for sharovik/devbot automation bot.

You can use this event for release optimisation of your project/projects. In the message should be specified 1 or multiple pull-requests. If the PRs are good to go, then bot will try to merge all of them into the main branch of selected repositories. The event accepts multiple pull-requests for multiple repositories. If there is more than one pull-request per repository, then bot will create a release pull-request, which should be approved by one of required reviewers, also will send this pull-request link to the channel, where it was triggered.

Table of contents

How it works

You send the message to the PM of bot with the next text:

release
https://bitbucket.org/{your-workspace}/{your-first-repository}/pull-requests/1/readmemd-edited-online-with-bitbucket/diff
https://bitbucket.org/{your-workspace}/{your-second-repository}/pull-requests/20
https://bitbucket.org/{your-workspace}/{your-second-repository}/pull-requests/36/release-pull-request/diff
https://bitbucket.org/{your-workspace}/{your-first-repository}/pull-requests/35/release-pull-request/diff

The bot tries to parse all pull-requests from your message and does several pull-requests checks:

  1. check the current state of the pull-request. If it's state is different then OPEN, the pull-request cannot be merged
  2. check if all the reviewers approved the pull-request
  3. tries to merge the pull-request into the destination
  4. if there is more than one pull-request, it will create the release pull-request and merge selected pull-request into new release branch destination

You can always ask bot release --help or bb release --help to see the usage of that command.

Prerequisites

Before you will start use this event, please be aware of these steps

Clone into devbot project

git clone [email protected]:sharovik/bitbucket-release-event.git events/bitbucketrelease

Install it into your devbot project

  1. clone this repository into events/ folder of your devbot project. Please make sure to use bitbucketrelease folder name for this event
  2. add into imports path to this event in defined-events.go file
import "github.com/sharovik/devbot/events/bitbucketrelease"
  1. add this event into defined-events.go file to the defined events map object
// DefinedEvents variable contains the list of events, which will be installed/used by the devbot
var DefinedEvents = []event.DefinedEventInterface{
	//...
	bitbucketrelease.Event,
}

Prepare environment variables in your .env

Copy and paste everything from the #Bitbucket section in .env.example file into .env file

Create BitBucket client

Here you can find how to do it.

The UseCase diagram

Here you can see the main flow how this event works

The main flow

The pull-request checks

In this diagram you can see how the current pull-request check works

The pull-request check

The release process

In this diagram you can see the flow of the release

The flow of the release

About

By using this event you can release your pull-request in bitbucket repository

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages