Is it possible to implement repo based hooks in Gitolite?

╄→гoц情女王★ 提交于 2019-12-06 08:07:41

问题


I want to implements repo based hooks in gitolite.

Is it Possible ?

I am using gitolite 3 (g3).


回答1:


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

  • 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",
  • uncomment the 'repo-specific-hooks' line in the rc file or add it to the ENABLE list if it doesn't exist.

  • 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.

  • 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
  • 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).

  • 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
  • add, commit, and push the admin repo.


来源:https://stackoverflow.com/questions/29541554/is-it-possible-to-implement-repo-based-hooks-in-gitolite

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