Skip to content

Instantly share code, notes, and snippets.

@manuelmeurer
Created September 15, 2014 15:13
Show Gist options
  • Save manuelmeurer/c9f2d4cdc717c5e67961 to your computer and use it in GitHub Desktop.
Save manuelmeurer/c9f2d4cdc717c5e67961 to your computer and use it in GitHub Desktop.
Gitlab hooks
git@web02:~/repositories/manuel/myapp.git/hooks$ ls -lah
total 48K
drwxrws--- 2 git git 4.0K Dec 3 2013 .
drwxrws--- 7 git git 4.0K Dec 3 2013 ..
-rwxrwx--- 1 git git 452 Dec 3 2013 applypatch-msg.sample
-rwxrwx--- 1 git git 896 Dec 3 2013 commit-msg.sample
-rwxrwx--- 1 git git 189 Dec 3 2013 post-update.sample
-rwxrwx--- 1 git git 398 Dec 3 2013 pre-applypatch.sample
-rwxrwx--- 1 git git 1.6K Dec 3 2013 pre-commit.sample
-rwxrwx--- 1 git git 1.3K Dec 3 2013 prepare-commit-msg.sample
-rwxrwx--- 1 git git 1.4K Dec 3 2013 pre-push.sample
-rwxrwx--- 1 git git 4.8K Dec 3 2013 pre-rebase.sample
lrwxrwxrwx 1 git git 35 Dec 3 2013 update -> /home/git/gitlab-shell/hooks/update
-rwxrwx--- 1 git git 3.6K Dec 3 2013 update.sample
git@web02:~/repositories/manuel/myapp.git/hooks$ cat update
#!/usr/bin/env ruby
# This file was placed here by GitLab. It makes sure that your pushed commits
# will be processed properly.
# You can add your own hooks to this file, but be careful when updating gitlab-shell!
refname = ARGV[0]
key_id = ENV['GL_ID']
repo_path = Dir.pwd
require_relative '../lib/gitlab_update'
GitlabUpdate.new(repo_path, key_id, refname).exec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment