为特定分支启用 Bazaar 插件操作(不适用于任何分支)
如何编写一个仅在提交特定分支时才执行的 post_commit (类似)插件?
现在我已经在“~/.bazaar/plugins/”目录中编写了一个插件,但问题是当提交存储库中的任何分支时该插件正在执行。
这个想法是触发对持续集成服务器(Hudson)的调用,以在提交修订时自动构建项目作业,
谢谢。
How can I write a post_commit (like) plugin that is executed only when a specific branch is commited?.
Right now I have written a plugin in "~/.bazaar/plugins/" directory, but the problem is that the plugin is executing when any branch in the repository is commited.
The idea is to trigger a call to a Continuous Integration server (Hudson) to automatically build the project-job when a revision is commited
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有自动方法将插件关联到特定分支,但您可以使用配置文件(branch.conf 或locations.conf)来控制插件的行为。因此,您的插件只应该打开分支配置并从那里读取一些选项,例如:
如果分支配置中存在必需的选项,那么您执行所需的操作,否则您的插件只是退出,仅此而已。
There is no automatic way to associate a plugin to specific branch, but you can use configuration files (either branch.conf or locations.conf) to control the behavior of your plugin. So your plugin only should open the branch config and read some option from there, for example:
And if required option is present in branch config then you execute required operations, otherwise your plugin simply exits and that's all.