specifying a gitblit hook per-repositry or per team

118 views
Skip to first unread message

chrobe...@gmail.com

unread,
Dec 18, 2015, 3:18:53 PM12/18/15
to gitblit
Hello,

I have been reading the gitblit documentation regarding hooks and it states:

Scripts may also be specified per-repository in the repository's settings.

but I can't find instructions on how to do that. I assume that I have to add the hook to the groovy.scriptsFolder  and then add something to the [gitblit] section of the config file in my repo (maybe a groovy.preReceiveScripts or groovy.postReceiveScripts entry - I'm not sure).

The docs also say:

Scripts can be specified for a team

 Once again I assume that that the scripts should be put into the groovy.scriptsFolder and something must be added to the users.conf file, but I'm not sure what that is.

Any help with this would be appreciated.

Thanks
Chris

James Moger

unread,
Dec 18, 2015, 4:53:14 PM12/18/15
to git...@googlegroups.com
The script does need to be put in the common hooks folder.

The expectation would be to configure the hooks via the web ui, but Gitblit does indeed modify .git/config and users.conf so if you wanted to to it manually.....

users.conf

[team "myteam"]
    preReceiveScript=yada
    postReceiveScript=yada

.git/config

[gitblit]
    preReceiveScript=yada
    postReceiveScript=yada

-J



--
You received this message because you are subscribed to the Google Groups "gitblit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gitblit+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

chrobe...@gmail.com

unread,
Dec 18, 2015, 5:11:49 PM12/18/15
to gitblit
Thanks for the answer, that really helps. I don't see anywhere on the web ui where I can specify that a hook is per-repo, team, or global...  is it context based, i.e., if I'm editing a particular repo and click edit/receive is the change for that repo only? If so, how do you affect the global and team hooks from the UI?

James Moger

unread,
Dec 21, 2015, 8:07:34 AM12/21/15
to git...@googlegroups.com
Thanks for the answer, that really helps. I don't see anywhere on the web ui where I can specify that a hook is per-repo, team, or global...  is it context based, i.e., if I'm editing a particular repo and click edit/receive is the change for that repo only? If so, how do you affect the global and team hooks from the UI?

Hooks can be set per repository or per team through the web ui using the edit team and edit repo functions.  Hooks can be specified globally for all repos using the groovy.preReceiveScripts and groovy.postReceiveScript settings in gitblit.properties.

-J

Reply all
Reply to author
Forward
0 new messages