Coder Social home page Coder Social logo

bitbucket-slack's Introduction

bitbucket-slack

BitbucketのPull Request、コミット、コメントをSlackにPostします

##コンセプト 1ファイルのわかりやすい構成としています。
最低限の実装なので、ご自由に改編して使ってください。
PHPの経験が少ない方でも改編して使って頂けるように極力シンプルに作ったつもりです。

##使い方

###前提 slackのチャンネル名は #test

WebAPIのTokenは取得済みである

参考: tokenの取得方法は割愛しますが以下のURLから取得できます。
https://api.slack.com/web

###最低限の設定

1.PHPが動くサーバーにファイルをおきます。

http://example.com/bitbucket2slack.php としてアクセスできる前提とします。

2.設置したファイル内のSLACK_API_TOKENを適切なtokenに書き換えます。

Bitbuketの通知を行いたいリポジトリにて設定Webhooksの設定を行ないます。

Settings-> Webhooks

URL設定欄にパラメータchannelを追加してURLを設定します。
(チャンネル名の#はつけません)
e.g. http://example.com/bitbucket2slack.php?channel=test

Triggers->Choose from a full list of triggers のチェックをいれ、 Pull Requestの必要箇所にチェックを入れます。

###その他 アイコンは適宜変えてください。 Webhooksのリクエストに、ユーザーのアイコン情報が含まれますので、 それらを使うように改変して頂くのもよいかと思います。

###動かない場合 USE_SYSTEM_LOG,USE_DISPLAY_LOG,SAVE_REQUEST_DATAの各項目をtrueに設定することで、 動作検証の手助けができます。 USE_SYSTEM_LOGを有効にした場合には、/var/log/httpd/error.logなどに出力されます。
※Webサーバーの設定により異なりますのでパスは適宜読み替えてください

bitbucket-slack's People

Contributors

whaison avatar akifumi-kamata avatar

Watchers

 avatar James Cloos 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.