summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2019-10-09 02:18:25 +0000
committerAsh McKenzie <amckenzie@gitlab.com>2019-10-09 02:18:25 +0000
commit1ee64eeaea71210e89040438489edac4701a1854 (patch)
tree4a9090f01965c912306a4fc286f690babcc62d11
parent9ba79e43395cf09e3c5904c541a011ea25b620f1 (diff)
parenta5991377f2b58e6c2cb3bb58ed6a2faa6b135c77 (diff)
downloadgitlab-shell-1ee64eeaea71210e89040438489edac4701a1854.tar.gz
Merge branch '173-remove-create-hooks-script' into 'master'
Remove deprecated create-hooks script See merge request gitlab-org/gitlab-shell!342
-rwxr-xr-xbin/create-hooks46
-rwxr-xr-xsupport/rewrite-hooks.sh5
2 files changed, 0 insertions, 51 deletions
diff --git a/bin/create-hooks b/bin/create-hooks
deleted file mode 100755
index 1adc809..0000000
--- a/bin/create-hooks
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/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_metrics')
-require 'fileutils'
-
-def create_hooks(path)
- global_hooks_directory = File.join(ROOT_PATH, 'hooks')
- local_hooks_directory = File.join(path, 'hooks')
- real_local_hooks_directory = :not_found
-
- begin
- real_local_hooks_directory = File.realpath(local_hooks_directory)
- rescue Errno::ENOENT
- # real_local_hooks_directory == :not_found
- end
-
- if real_local_hooks_directory != File.realpath(global_hooks_directory)
- if File.exist?(local_hooks_directory)
- $logger.info "Moving existing hooks directory and symlinking global hooks directory for #{path}."
- FileUtils.mv(local_hooks_directory, "#{local_hooks_directory}.old.#{Time.now.to_i}")
- end
- FileUtils.ln_sf(global_hooks_directory, local_hooks_directory)
- else
- $logger.info "Hooks already exist for #{path}."
- true
- end
-end
-
-repository_storage_paths = ARGV
-
-repository_storage_paths.each do |repo_path|
- Dir["#{repo_path.chomp('/')}/**/*.git"].each do |repo|
- begin
- GitlabMetrics.measure('command-create-hooks') do
- create_hooks(repo)
- end
- rescue Errno::ENOENT
- # The user must have deleted their repository. Ignore.
- end
- end
-end
diff --git a/support/rewrite-hooks.sh b/support/rewrite-hooks.sh
deleted file mode 100755
index 585eaeb..0000000
--- a/support/rewrite-hooks.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-# This script is deprecated. Use bin/create-hooks instead.
-
-gitlab_shell_dir="$(cd $(dirname $0) && pwd)/.."
-exec ${gitlab_shell_dir}/bin/create-hooks