Giter Club home page Giter Club logo

bitrocket's Introduction

Bitrocket Logo

BitRocket


Overview | Features | Installation | Team | Copyright & License



Overview

Connect Alassian BitBucket Server or Alassian BitBucket Cloud with Rocket.Chat and send notifications to users or channels on each push, pull requests or comments on pull requests to any branch.



Features

This script uses BitBuckets Post-Receive WebHooks to submit a payload to your Rocket.Chat intance, which parses the payload and then posts a message containing differen information.




Installation

Download code

Download source from here.
Unzip Sources.


Configure Rocket.Chat

Add user (optional)

This step is optional if you've already got a user which you want to use as post author you can skip this step.
Otherwise add a new user who is posting the updates to your channel or who ist texting the user which is supposed to be informed.

Configure incoming Webhook in Rocket.Chat

In your Rocket.Chat instance go to administration panel an click on "Integrations". To add an integration with BitRocket click on "NEW INTEGRATION".
Next, choose "Incoming WebHook".
Now, on the webhook config screen, set the following values:

Enabled

Set this value to true

Name (optional)

Enter the desired name for the integration (e.g. "BitRocket").

Post to Channel

Self-explaining option. Insert the desired channel or user which receives the post on pushing to your repositories.
An example user would be @username, an example channel would be #channelname.

Post as

Here you've got to define the user who is posting the updates. This is the user you've created earlier.

Script Enabled

Set this setting to true.

BitBucket Cloud Script

When using BitBucket Cloud you have to insert the complete code of the file BBCloud__POSTReceiveHook.js into this field.

Configure Messages:

First, configure your colors and, to get links working, configure your bitbucket server root url:

const config = {
    colorDefault: '#225159',
    colorError: '#8D2A12',
    colorSuccess: '#14720a',
    bitbucketUrl: '{ configure me :-) }'
};



Now set, which notification you want to receive in Rocket.Chat

const showNotifications = {
    'repo:refs_changed': true,
    'repo:forked': true,
    'repo:comment:added': true,
    'repo:comment:edited': true,
    'repo:comment:deleted': true,
    'pr:opened': true,
    'pr:reviewer:approved': true,
    'pr:reviewer:unapproved': true,
    'pr:reviewer:needs_work': true,
    'pr:merged': true,
    'pr:declined': true,
    'pr:deleted': true,
    'pr:comment:added': true,
    'pr:comment:deleted': true,
    'pr:comment:edited': true
};





BitBucket Server Script

When using BitBucket Server you have to insert the complete code of the file bitbucket_5_6_native-webhook.js into this field.

Save changes

Now click on "SAVE CHANGES" to get the required information (it is possible that you'll receive an empty error message below the "Script" option - just ignore it).



Configure BitBucket Cloud

Create Post-Receive WebHook in repository

Navigate to the desired repository and click on "Settings" in the left column.
Now click on "Webhooks" and then on "Add webhook".
The opening page provides an input field for defining your webhook title and your webhook url.
Please enter the correct url to your Rocket.Chat webhook (just copy it from Rocket.Chat integration settings).
On the "Triggers"-option select "Choose from a full list of triggers". In the following list check "Repository -> Push" and every option below "Pull Request"
You can select everything here and overwrite this settings in the script-config directly inside of Rocket.Chat.

Supported triggers
  • Repository Events
    • Push
    • Fork
    • Commit Comment Created
    • Commit Status Created (Example payload needed)
    • Commit Status Updated (Example payload needed)
  • Issue Events
    • Created (Example payload needed)
    • Updated (Example payload needed)
    • Comment Created (Example payload needed)
  • Pull Request Events
    • Created
    • Updated
    • Approved (BitBucket provides insufficient info)
    • Approval Removed (BitBucket provides insufficient info)
    • Merged
    • Declined
    • Comment Created
    • Comment Updated
    • Comment Deleted

Click on "Save" and your done!



Configure BitBucket Server

Create WebHook in repository

Navigate to the desired repository and click on "Settings" in the left column.
Now click on "Webhooks" and add a new one.
After inserting your data, previously entered in RocketChat test the connection.
Click on "Save" and your done!



Want to contribute?

I forked this from FinndropStudios/BitRocket. Feel free to also do this.



Team (originally code)

Manuel Bachl ([email protected])
Thies Schneider ([email protected])



This fork

Markus Bauer ([email protected])



Copyright & License

Finndrop Studios
Copyright (c) 2016 โ€žFinndrop Studiosโ€œ

Licensed under the MIT license.

bitrocket's People

Contributors

patrickpl avatar rukenshia avatar sckelemen avatar timhagn avatar

Watchers

Sourabh Wathare avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.