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
Kazuhiko Shiozaki
gitlab-shell
Commits
9ab685c8
Commit
9ab685c8
authored
Sep 16, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.9.8-symlink-hooks-directory' into 'version-1-9'
1.9.8: symlink hooks directory See merge request !45
parents
33c2bca5
cc1bf32e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
CHANGELOG
CHANGELOG
+1
-0
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+7
-3
No files found.
CHANGELOG
View file @
9ab685c8
v1.9.8
v1.9.8
- Ignore missing repositories in create-hooks
- Ignore missing repositories in create-hooks
- Symlink the whole hooks directory
v1.9.7
v1.9.7
- Increased test coverage
- Increased test coverage
...
...
lib/gitlab_projects.rb
View file @
9ab685c8
...
@@ -5,6 +5,8 @@ require_relative 'gitlab_config'
...
@@ -5,6 +5,8 @@ require_relative 'gitlab_config'
require_relative
'gitlab_logger'
require_relative
'gitlab_logger'
class
GitlabProjects
class
GitlabProjects
GLOBAL_HOOKS_DIRECTORY
=
File
.
join
(
ROOT_PATH
,
'hooks'
)
# Project name is a directory name for repository with .git at the end
# Project name is a directory name for repository with .git at the end
# It may be namespaced or not. Like repo.git or gitlab/repo.git
# It may be namespaced or not. Like repo.git or gitlab/repo.git
attr_reader
:project_name
attr_reader
:project_name
...
@@ -18,9 +20,11 @@ class GitlabProjects
...
@@ -18,9 +20,11 @@ class GitlabProjects
attr_reader
:full_path
attr_reader
:full_path
def
self
.
create_hooks
(
path
)
def
self
.
create_hooks
(
path
)
hook
=
File
.
join
(
path
,
'hooks'
,
'update'
)
local_hooks_directory
=
File
.
join
(
path
,
'hooks'
)
File
.
delete
(
hook
)
if
File
.
exists?
(
hook
)
unless
File
.
realpath
(
local_hooks_directory
)
==
File
.
realpath
(
GLOBAL_HOOKS_DIRECTORY
)
File
.
symlink
(
File
.
join
(
ROOT_PATH
,
'hooks'
,
'update'
),
hook
)
FileUtils
.
mv
(
local_hooks_directory
,
"
#{
local_hooks_directory
}
.old.
#{
Time
.
now
.
to_i
}
"
)
FileUtils
.
ln_s
(
GLOBAL_HOOKS_DIRECTORY
,
local_hooks_directory
)
end
end
end
def
initialize
def
initialize
...
...
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