Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-shell
Commits
a5991377
Commit
a5991377
authored
Oct 02, 2019
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated create-hooks script
parent
9ba79e43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
51 deletions
+0
-51
bin/create-hooks
bin/create-hooks
+0
-46
support/rewrite-hooks.sh
support/rewrite-hooks.sh
+0
-5
No files found.
bin/create-hooks
deleted
100755 → 0
View file @
9ba79e43
#!/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
support/rewrite-hooks.sh
deleted
100755 → 0
View file @
9ba79e43
#!/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment