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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-shell
Commits
3bd2b660
Commit
3bd2b660
authored
Feb 25, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make support/rewrite-hooks.sh use bin/create_hooks
parent
02b960c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
26 deletions
+15
-26
bin/create-hooks
bin/create-hooks
+12
-0
support/rewrite-hooks.sh
support/rewrite-hooks.sh
+3
-26
No files found.
bin/create-hooks
0 → 100755
View file @
3bd2b660
#!/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
support/rewrite-hooks.sh
View file @
3bd2b660
#!/bin/bash
# This script is deprecated. Use bin/create-hooks instead.
# $1 is an optional argument specifying the location of the repositories directory.
# Defaults to /home/git/repositories if not provided
home_dir
=
"/home/git"
src
=
${
1
:-
"
$home_dir
/repositories"
}
function
create_link_in
{
ln
-s
-f
"
$home_dir
/gitlab-shell/hooks/update"
"
$1
/hooks/update"
}
for
dir
in
`
ls
"
$src
/"
`
do
if
[
-d
"
$src
/
$dir
"
]
;
then
if
[[
"
$dir
"
=
~ ^.
*
\.
git
$
]]
then
create_link_in
"
$src
/
$dir
"
else
for
subdir
in
`
ls
"
$src
/
$dir
/"
`
do
if
[
-d
"
$src
/
$dir
/
$subdir
"
]
&&
[[
"
$subdir
"
=
~ ^.
*
\.
git
$
]]
;
then
create_link_in
"
$src
/
$dir
/
$subdir
"
fi
done
fi
fi
done
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