diff options
author | Nick Thomas <nick@gitlab.com> | 2019-10-02 15:21:25 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-10-08 12:18:23 +0100 |
commit | a5991377f2b58e6c2cb3bb58ed6a2faa6b135c77 (patch) | |
tree | 4a9090f01965c912306a4fc286f690babcc62d11 | |
parent | 9ba79e43395cf09e3c5904c541a011ea25b620f1 (diff) | |
download | gitlab-shell-a5991377f2b58e6c2cb3bb58ed6a2faa6b135c77.tar.gz |
Remove deprecated create-hooks script
-rwxr-xr-x | bin/create-hooks | 46 | ||||
-rwxr-xr-x | support/rewrite-hooks.sh | 5 |
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 |