本文介绍了是否可以在Gitolite中实现基于回购的挂钩?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在gitolite中实现基于回购的钩子.

I want to implements repo based hooks in gitolite.

有可能吗?

我正在使用3号乙醇钠(g3).

I am using gitolite 3 (g3).

推荐答案

自Gitolite 3.6+起,可以通过"特定于存储库的钩子":

Since Gitolite 3.6+, it is possible with "repo-specific hooks":

LOCAL_CODE => "$rc{GL_ADMIN_BASE}/local",

如果您的 rc 文件没有 ENABLE 列表,则需要将其添加到 POST_COMPILE POST_CREATE 列表.单击此处,以获取有关所有这些内容的更多信息.

If your rc file does not have an ENABLE list, you need to add this to the POST_COMPILE and the POST_CREATE lists. Click here for more on all this.

将您的钩子插入到 gitolite-admin 克隆中,如下所示:

put your hooks into your gitolite-admin clone, as follows:

工作站上的

# on your workstation
cd /path/to/your/gitolite-admin-clone
mkdir -p local/hooks/repo-specific

将它们添加到您希望它们在conf文件中处于活动状态的仓库中.例如:

add them to the repos you want them to be active in, in your conf file. For example:

repo foo
    option hook.post-update     =   jenkins
repo bar @baz
    option hook.post-update     =   deploy RSS-post

这篇关于是否可以在Gitolite中实现基于回购的挂钩?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 11:42