是否可以在Gitolite中实现基于回购的挂钩? [英] Is it possible to implement repo based hooks in Gitolite?
问题描述
我想在gitolite中实现基于回购的钩子.
I want to implements repo based hooks in gitolite.
有可能吗?
我正在使用3号乙醇钠(g3).
I am using gitolite 3 (g3).
推荐答案
Since Gitolite 3.6+, it is possible with "repo-specific hooks":
- 将此行添加到
%RC
块中的rc
文件中(如果尚不存在),或取消注释(如果已存在并注释掉):
- add this line in the
rc
file, within the%RC
block, if it's not already present, or uncomment it if it's already present and commented out:
LOCAL_CODE => "$rc{GL_ADMIN_BASE}/local",
取消注释
rc
文件中的"repo-specific-hooks
"行,或者将其添加到ENABLE
列表中不存在.
uncomment the '
repo-specific-hooks
' line in therc
file or add it to theENABLE
list if it doesn't exist.
如果您的 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
现在将钩子添加到该目录,但不要使用git标准"名称(
预接收
,后接收
,更新后
),则使用描述性名称(例如"deploy
","RSS-post
"等).
Now add your hooks to that directory, but instead of using the git "standard" names (
pre-receive
,post-receive
,post-update
), you use descriptive names (e.g. "deploy
", "RSS-post
", etc).
将它们添加到您希望它们在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中实现基于回购的挂钩?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!