All Projects → cvitter → mattermost-bitbucket-bridge

cvitter / mattermost-bitbucket-bridge

Licence: MIT license
Flask application that serves as a bridge between Bitbucket and Mattermost.

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to mattermost-bitbucket-bridge

deployserver
Deploy your project automatically when git branch was updated.
Stars: ✭ 24 (+33.33%)
Mutual labels:  webhook, bitbucket
notify
推送通知 sdk(Bark、Chanify、钉钉群机器人、Discord、邮件、飞书群机器人、Gitter、Google Chat、iGot、Logger、Mattermost、Now Push、PushBack、Push、PushDeer、PushPlus、QQ 频道机器人、Rocket Chat、Server 酱、Showdoc Push、Slack、Telegram、Webhook、企业微信群机器人、息知、Zulip)。
Stars: ✭ 335 (+1761.11%)
Mutual labels:  webhook, mattermost
froggit-go
Froggit-Go is a universal Go library, allowing to perform actions on VCS providers.
Stars: ✭ 19 (+5.56%)
Mutual labels:  webhook, bitbucket
Skyhook
Parses webhooks and forwards them in the proper format to Discord.
Stars: ✭ 263 (+1361.11%)
Mutual labels:  webhook, bitbucket
Git Deploy
Php Script for Auto-Pull in server (Using WebHook from GitLab, GitHub and Bitbucket)
Stars: ✭ 495 (+2650%)
Mutual labels:  webhook, bitbucket
Generic Webhook Trigger Plugin
Can receive any HTTP request, extract any values from JSON or XML and trigger a job with those values available as variables. Works with GitHub, GitLab, Bitbucket, Jira and many more.
Stars: ✭ 287 (+1494.44%)
Mutual labels:  webhook, bitbucket
pm2-githook
receive webhook from github/gitlab and ask pm2 to reload the application for you
Stars: ✭ 39 (+116.67%)
Mutual labels:  webhook, bitbucket
Hooka
😎 A webhook server with zero coding
Stars: ✭ 180 (+900%)
Mutual labels:  webhook, bitbucket
Git Auto Deploy
Deploy your GitHub, GitLab or Bitbucket projects automatically on Git push events or web hooks
Stars: ✭ 251 (+1294.44%)
Mutual labels:  webhook, bitbucket
mattermost-govet
No description or website provided.
Stars: ✭ 13 (-27.78%)
Mutual labels:  mattermost
snmp notifier
A webhook to relay Prometheus alerts as SNMP traps, because sometimes, you have to deal with legacy
Stars: ✭ 33 (+83.33%)
Mutual labels:  webhook
bitbucket-sync
Mirror of BitBucket Sync project hosted on BitBucket
Stars: ✭ 18 (+0%)
Mutual labels:  bitbucket
mattermost-rtl
Adds RTL support to Mattermost
Stars: ✭ 52 (+188.89%)
Mutual labels:  mattermost
GitWebLinks
Copy links to files in their online Git repositories from inside Visual Studio Code and Visual Studio 2022.
Stars: ✭ 28 (+55.56%)
Mutual labels:  bitbucket
mattermost-api-reference
Mattermost API reference documentation.
Stars: ✭ 74 (+311.11%)
Mutual labels:  mattermost
plugin-gogs-webhook
[NOT MAINTAINED] Plugin to handle Gogs Webhooks
Stars: ✭ 29 (+61.11%)
Mutual labels:  webhook
git-the-lines
A Discord bot that prints out the lines referenced in a GitHub, GitLab, or BitBucket snippet link
Stars: ✭ 37 (+105.56%)
Mutual labels:  bitbucket
Aftermath
A simple anti token-grabber, written in Python.
Stars: ✭ 40 (+122.22%)
Mutual labels:  webhook
dialogflow-webhook-response-libary-in-python
This library simplifies the JSON response building in Python for Dialogflow.
Stars: ✭ 56 (+211.11%)
Mutual labels:  webhook
gosquito
gosquito ("go" + "mosquito") is a pluggable tool for data gathering, data processing and data transmitting to various destinations.
Stars: ✭ 25 (+38.89%)
Mutual labels:  mattermost

Bitbucket Webhook Bridge for Mattermost

This repository is contains a Python Flask application that accepts webhooks from Bitbucket Server and forwards them to the specified channel in a Mattermost server via an incoming webhook. The bridge application supports a number of usage scenarios including:

  • One Bitbucket repository to one Mattermost incoming webhook (one to one);
  • Many Bitbucket repositories to many Mattermost incoming webhooks (many to many) and;
  • Many Bitbucket repositories to one Mattermost incoming webhook (many to one).

Information on setting up for the different usage scenarios can be found below.

Import Notes:

  • This application has been tested with Bitbucket Server 5.10.1 and BitBucket Cloud
  • This application was written extremely quickly and could use additional work in the form of refactoring, the addition of error handling, and testing (including on different versions of Bitbucket). Please feel free to jump in and help with pull requests, issues, etc.
  • This application is an example of how to bridge Bitbucket webhooks to Mattermost and is not meant to be used in a production environment.

Supported Bitbucket Events

The following events are supported and tested in the current version of this application:

  • Pull request comment added
  • Pull request comment deleted
  • Pull request comment edited
  • Pull request declined
  • Pull request deleted
  • Pull request merged
  • Pull request modified
  • Pull request opened
  • Repository commit comment added
  • Repository commit comment deleted
  • Repository commit comment edited
  • Repository forked
  • Repository refs updated

Setup the Flask Application

The following steps

  1. Log into the machine that will host the Python Flask application;
  2. Clone this repository to your machine: git clone https://github.com/cvitter/mattermost-bitbucket-bridge.git;
  3. Make a copy of config.sample: cp config.sample config.json
  4. Edit config.json to update the following fields as needed:
    • Application host address and port (generally debug should be left set to false;
    • Mattermost server_url and the user name or icon to override the webhook with if desired;
    • And the base url of your Bitbucket server. (Leave empty to use BitBucket Cloud)
  5. Run the Flask application - there are a number of ways to run the application but I use the following command that runs the application headlessly and captures output into a log file for troubleshooting:
sudo python bitbucket.py >> bitbucket.log 2>&1 &

Configure Mattermost

To use this application you will need to create one or more Incoming Webhooks in Mattermost. These incoming webhooks will be the endpoints that the application will post the events received from Bitbucket. Webhooks are created by navigating to Integrations in the Main Menu, clicking on Incoming Webhooks, and clicking on Add Incoming Webhook. After creating the incoming webhook you will need to copy the webhook's code at the end of its URL which will be needed when configuring the webhook in Bitbucket.

Note: You can have all Bitbucket events post to a single webhook or, or setup incoming webhooks in Mattermost for each Bitbucket repository.

Configure Bitbucket

Within Bitbucket webhooks are configured and managed at the individual repository level. From within a repository click on the Repository Settings icon (cog) in the left hand side bar and then click on Webhooks under repository settings. To create a new webhook click on the Create webhook button. In the Create webhook form fill in the new webhook's Name and URL. The URL will look like:

http://flask-application-url:port/hooks/[hookcode]

Note: The hook code is the unique hook identifier generated by Mattermost and is found at the end of your Mattermost's incoming webhook URL, ex: https://mymattermostserver.com/hooks/5iz1k8j8rewrjyu3anbw4u66qe.

Then select the Repository and Pull request events you want to be notified about and click on Create to create the webhook.

Docker Installation

To use the docker based installation created by ronhks:

  1. Log into the machine that will host the Python Flask application;
  2. Clone this repository to your machine: git clone https://github.com/cvitter/mattermost-bitbucket-bridge.git;
  3. Make a copy of config.sample: cp config.sample config.json
  4. Edit config.json to update the following fields as needed:
    • Application host address and port (generally debug should be left set to false;
    • Mattermost server_url and the user name or icon to override the webhook with if desired;
    • And the base url of your Bitbucket server.
  5. Build the docker image (replace DOCKER_IMAGE_NAME with your name of choice):
  • docker build -t DOCKER_IMAGE_NAME .
  • docker pull DOCKER_IMAGE_NAME
  1. And run the docker image: docker run -d -p 5006:5006 DOCKER_IMAGE_NAME

Make this Project Better (Questions, Feedback, Pull Requests Etc.)

Help! If you like this project and want to make it even more awesome please contribute your ideas, code, etc.

If you have any questions, feedback, suggestions, etc. please submit them via issues here: https://github.com/cvitter/mattermost-bitbucket-bridge/issues

If you find errors please feel to submit pull requests. Any help in improving this resource is appreciated!

License

The content in this repository is Open Source material released under the MIT License. Please see the LICENSE file for full license details.

Disclaimer

The code in this repository is not sponsored or supported by Mattermost, Inc.

Authors

Contributors

Please submit Issues and/or Pull Requests.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].