summaryrefslogtreecommitdiff
path: root/bin/create-hooks
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-26 11:03:01 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-26 11:03:01 +0000
commit704b08adbd16a1d7f610478d8f77cca36a1981b5 (patch)
tree2b1ee9d230ae4c5e76617e7979c174b5015accfb /bin/create-hooks
parent56e216f33ca0db21336cc8dc1f7e09a834267772 (diff)
parent3bd2b660ff550e3eddea5b4b113ee79cf66e0f7f (diff)
downloadgitlab-shell-704b08adbd16a1d7f610478d8f77cca36a1981b5.tar.gz
Merge branch 'create_hooks' into 'master'
Add bin/create-hooks command for backup restores This solves the problem that `support/rewrite-hooks.sh` assumes that the gitlab-shell is installed in `/home/git/gitlab-shell`, which does not hold for omnibus-gitlab.
Diffstat (limited to 'bin/create-hooks')
-rwxr-xr-xbin/create-hooks12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/create-hooks b/bin/create-hooks
new file mode 100755
index 0000000..d6f07c7
--- /dev/null
+++ b/bin/create-hooks
@@ -0,0 +1,12 @@
+#!/usr/bin/env ruby
+
+# Recreate GitLab hooks in the Git repositories managed by GitLab.
+#
+# This script is used when restoring a GitLab backup.
+
+require_relative '../lib/gitlab_init'
+require File.join(ROOT_PATH, 'lib', 'gitlab_projects')
+
+Dir["#{GitlabConfig.new.repos_path}/*/*.git"].each do |repo|
+ GitlabProjects.create_hooks(repo)
+end