summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2013-08-06 16:35:53 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2013-08-26 10:16:24 +0200
commit4f9deebaf3f4f47076f2db059406320d5799cb52 (patch)
treed764ff0c3a0e9fc3b061126b9cf55922a7ae7fbb /hooks
parent4fc02372fe62f4f1b4c6618707de56c11ecc8451 (diff)
downloadgitlab-shell-add_local_update_hook.tar.gz
Allow update.local hook after update.gitlabadd_local_update_hook
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/update20
-rwxr-xr-xhooks/update.gitlab13
2 files changed, 23 insertions, 10 deletions
diff --git a/hooks/update b/hooks/update
index 549afeb..90b0c6b 100755
--- a/hooks/update
+++ b/hooks/update
@@ -1,13 +1,13 @@
-#!/usr/bin/env ruby
+#!/bin/bash
+# GitLab update hook -- do not modify!
+# To add your own update hook, create an update.local executable
-# 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!
+hooks_dir="$(cd `dirname $0` && pwd)"
+update_gitlab="$hooks_dir/update.gitlab"
+update_local="$hooks_dir/update.local"
-refname = ARGV[0]
-key_id = ENV['GL_ID']
-repo_path = `pwd`
+$update_gitlab "$@" || exit 1
-require_relative '../lib/gitlab_update'
-
-GitlabUpdate.new(repo_path, key_id, refname).exec
+if [ -x $update_local ]; then
+ $update_local "$@" || exit 1
+fi
diff --git a/hooks/update.gitlab b/hooks/update.gitlab
new file mode 100755
index 0000000..0979926
--- /dev/null
+++ b/hooks/update.gitlab
@@ -0,0 +1,13 @@
+#!/usr/bin/env ruby
+
+# This file was placed here by GitLab. It makes sure that your pushed commits
+# will be processed properly. See the `update` script for instructions on how
+# to add your own update hooks.
+
+refname = ARGV[0]
+key_id = ENV['GL_ID']
+repo_path = `pwd`
+
+require_relative '../lib/gitlab_update'
+
+GitlabUpdate.new(repo_path, key_id, refname).exec