return ([args], None)
+class GitoliteHook(webhooks.base):
+ def getChanges(self, request):
+ try:
+ branch = request.args[b"branch"][0].decode("utf-8")
+ project = request.args[b"project"][0].decode("utf-8")
+ repository = request.args[b"repository"][0].decode("utf-8")
+ author = request.args[b"author"][0].decode("utf-8")
+ except Exception as e:
+ raise ValueError("Error missing key in request: " + str(e))
+
+ args = {
+ "author": "gitolite for " + author,
+ "category": "gitolite-hooks",
+ "comments": "gitolite post-receive hook",
+ "branch": branch,
+ "project": project,
+ "repository": repository,
+ }
+
+ return ([args], None)
+
userInfoProvider = util.LdapUserInfo(
uri=E.LDAP_URL,
bindUser=E.LDAP_ADMIN_USER,
secrets.SecretInAFile(E.SECRETS_FILE),
],
"www": {
- "change_hook_dialects": { "base": { "custom_class": CustomBase } },
+ "change_hook_dialects": {
+ "base": { "custom_class": CustomBase },
+ "gitolite": { "custom_class": GitoliteHook },
+ },
"plugins": {
"waterfall_view": {},
"console_view": {},