Telegram notifications from Bitbucket



The essence of the project



When I first got my first job as a Java developer, I immediately had an event notification issue in Bitbucket. The direction of Java development was new (I was the second programmer), so I had to set up the development environment. After installing and configuring Bitbucket Server, I had to rummage through Pull Requests in search of new comments that needed to be answered, and it was problematic to learn about new Pull Reqests. Yes, someone will say that there are email notifications, but common, we have the Telegram era.



disclaimer: , , , " ", issues.



open source, , open source. . , , Telegram, - , .



Maven Central.





, . " " , Pull Request-ax ( PR). . :



  • PR,




  • PR




  • PR, ( )




  • PR (MERGE, DECLINE, DELETE)




  • ,






  • PR




  • PR




  • PR. , , PR . 2 , , 4 - , . .




? , , , , . , — , , . Bitbucket Cloud Gitlab.



, , . :



  • , PR
  • ,
  • PR


Teamcity!









. API , PR , Telegram. API Bitbucket.



C API , , API -. , . Bitbucket.



, . API , Bitbucket Server. .



id -, , PR, PR . Bitbucket, , PR, .



- . PR , , . -, .



, , , . , .





. , .



  1. docker



    docker pull upagge/bitbucket-bot-local:latest
  2. Telegram, .
  3. , . : 34534050345:FlfrleflerferfRE-ergerFLREF9ERF-NGjM
  4. bitbucket. , Manage Account --> Personal access tokens --> Create a token. .
  5. , PR .


docker run --name bitbucketbot -d --env TELEGRAM_BOT_TOKEN=value --env TELEGRAM_BOT_USERNAME=value --env BITBUCKET_TOKEN=value --env TELEGRAM_ID=value --env BITBUCKET_URL=value --env BITBUCKET_LOGIN=value --env DATASOURCE_URL=value --env DATASOURCE_USERNAME=value --env DATASOURCE_PASSWORD=value --network="host" upagge/bitbucket-bot-local:latest


value . :



  • TELEGRAM_BOT_TOKEN — , .
  • TELEGRAM_BOT_USERNAME — , . my_bitbucket_bot
  • BITBUCKET_TOKEN — , Bitbucket
  • TELEGRAM_ID — id telegram,
  • BITBUCKET_URL - url to your bitbucket strictly in this format http: // localhost: 7990
  • BITBUCKET_LOGIN - your bitbucket login, for example mylogin
  • DATASOURCE_URL - link to Postgres database , in the following format: jdbc: postgresql: // localhost: 5432 / bitbucket_bot_local
  • DATASOURCE_USERNAME - database user
  • DATASOURCE_PASSWORD - password from the database



All Articles