Create a BitBucket git commit hook?

让人想犯罪 __ 提交于 2019-12-02 22:06:16

I was able to find a solution. Although John Percival's answer is right, no current support for Ruby, the notification mechanism works.

The code for the Ruby app is in the question. Notice how it looks for a post via post '/' do. I was able to find support to send a POST to a URL in this neat find here: http://read-the-docs.readthedocs.org/en/latest/webhooks.html

Given that info, I was able to create a POST hook in BitBucket via:

  1. Go to repo "admin" tab
  2. Select "services"
  3. Create a POST service to a special port on my URL http://server.com:4567/

Take a look at https://confluence.atlassian.com/display/BITBUCKET/Write+brokers+%28hooks%29+for+Bitbucket

It looks like the BitBucket folks may not support Ruby, they do support a notification mechanism.

UPDATE: https://confluence.atlassian.com/display/BITBUCKET/Manage+Webhooks#ManageWebhooks-create_webhook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!