@register_hook
def gitlab_hook_helper(data):
 ssh_url = data['repository']['url']
 http_url = '.'.join((data['repository']['homepage'], 'git'))
 branch = re.sub('^refs/heads/', '', data['ref'])
 repos = [ssh_url, http_url, data['repository']['git_http_url'], data['repository']['git_ssh_url']]
 return {'service_long_name': 'GitLab', 'repo_url': data['repository']['homepage'], 'repos': repos, 'branch': branch}

@ register_hook def gitlab_hook_helper ( data ) : ssh_url = data [ 'repository' ] [ 'url' ] http_url = '.' . join ( ( data [ 'repository' ] [ 'homepage' ] , 'git' ) ) branch = re . sub ( '^refs/heads/' , '' , data [ 'ref' ] ) repos = [ ssh_url , http_url , data [ 'repository' ] [ 'git_http_url' ] , data [ 'repository' ] [ 'git_ssh_url' ] ] return { 'service_long_name' : 'GitLab' , 'repo_url' : data [ 'repository' ] [ 'homepage' ] , 'repos' : repos , 'branch' : branch }
api to handle commit hooks from gitlab .