创建一个BitBucket git commit hook? [英] Create a BitBucket git commit hook?

查看:452
本文介绍了创建一个BitBucket git commit hook?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从GitHub移植到BitBucket。尽管它有许多必需品,但我发现很难找到创建git commit hook的文档。



最初,我在CentOS服务器上安装了一个Ruby应用程序,由GitHub钩子触发。有人知道如何在BitBucket环境中实现相同的功能吗?



谢谢!

编辑: 下面是ruby应用程序如果有帮助的样子:

  post'/'do 
` rm -rf repofolder`
`git clone https:// user @ bitbucket.org / user / repo.git`
`sh fast_deploy.sh`
end


解决方案

我能找到解决方案。尽管John Percival的回答是正确的,但目前没有支持Ruby的通知机制。



Ruby应用程序的代码存在问题。注意它是如何通过 post'/'do 查找帖子的。我能够找到支持发送一个POST到这个整洁的URL找到这里: http:/ /read-the-docs.readthedocs.org/en/latest/webhooks.html



考虑到这些信息,我可以创建一个POST钩子BitBucket通过:


  1. 转至回购admin选项卡

  2. 选择services >
  3. 在我的URL http://server.com:4567/

  4. 上为特殊端口创建POST服务


I just ported over a repo from GitHub to BitBucket. Although it does many of necessities, I'm finding it surprisingly difficult to find documentation for creating a git commit hook.

Originally I had a ruby app on a CentOS server that was triggered by a GitHub hook. Does anyone know how to achieve the same in the BitBucket environment?

Thanks!

Edit: here's what the ruby app simply looks like if it helps:

post '/' do
  `rm -rf repofolder`
  `git clone https://user@bitbucket.org/user/repo.git`
  `sh fast_deploy.sh`
end

解决方案

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/

这篇关于创建一个BitBucket git commit hook?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆