summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-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