Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
45a6b624
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
45a6b624
编写于
9月 16, 2014
作者:
J
Jacob Vosmaer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Check for hooks directory symlink in gitlab:check
上级
71e05544
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
62 deletion
+17
-62
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+17
-62
未找到文件。
lib/tasks/gitlab/check.rake
浏览文件 @
45a6b624
...
...
@@ -356,8 +356,7 @@ namespace :gitlab do
check_repo_base_user_and_group
check_repo_base_permissions
check_satellites_permissions
check_update_hook_is_up_to_date
check_repos_update_hooks_is_link
check_repos_hooks_directory_is_link
check_gitlab_shell_self_test
finished_checking
"GitLab Shell"
...
...
@@ -367,29 +366,6 @@ namespace :gitlab do
# Checks
########################
def
check_update_hook_is_up_to_date
print
"update hook up-to-date? ... "
hook_file
=
"update"
gitlab_shell_hooks_path
=
Gitlab
.
config
.
gitlab_shell
.
hooks_path
gitlab_shell_hook_file
=
File
.
join
(
gitlab_shell_hooks_path
,
hook_file
)
if
File
.
exists?
(
gitlab_shell_hook_file
)
puts
"yes"
.
green
else
puts
"no"
.
red
puts
"Could not find
#{
gitlab_shell_hook_file
}
"
try_fixing_it
(
'Check the hooks_path in config/gitlab.yml'
,
'Check your gitlab-shell installation'
)
for_more_information
(
see_installation_guide_section
"GitLab Shell"
)
end
end
def
check_repo_base_exists
print
"Repo base directory exists? ... "
...
...
@@ -508,18 +484,10 @@ namespace :gitlab do
end
end
def
check_repos_
update_hooks
_is_link
print
"
update hook
s in repos are links: ... "
def
check_repos_
hooks_directory
_is_link
print
"
hooks directorie
s in repos are links: ... "
hook_file
=
"update"
gitlab_shell_hooks_path
=
Gitlab
.
config
.
gitlab_shell
.
hooks_path
gitlab_shell_hook_file
=
File
.
join
(
gitlab_shell_hooks_path
,
hook_file
)
gitlab_shell_ssh_user
=
Gitlab
.
config
.
gitlab_shell
.
ssh_user
unless
File
.
exists?
(
gitlab_shell_hook_file
)
puts
"can't check because of previous errors"
.
magenta
return
end
unless
Project
.
count
>
0
puts
"can't check, you have no projects"
.
magenta
...
...
@@ -529,38 +497,25 @@ namespace :gitlab do
Project
.
find_each
(
batch_size:
100
)
do
|
project
|
print
sanitized_message
(
project
)
project_hook_directory
=
File
.
join
(
project
.
repository
.
path_to_repo
,
"hooks"
)
if
project
.
empty_repo?
puts
"repository is empty"
.
magenta
elsif
File
.
realpath
(
project_hook_directory
)
==
File
.
realpath
(
gitlab_shell_hooks_path
)
puts
'ok'
.
green
else
project_hook_file
=
File
.
join
(
project
.
repository
.
path_to_repo
,
"hooks"
,
hook_file
)
unless
File
.
exists?
(
project_hook_file
)
puts
"missing"
.
red
try_fixing_it
(
"sudo -u
#{
gitlab_shell_ssh_user
}
ln -sf
#{
gitlab_shell_hook_file
}
#{
project_hook_file
}
"
)
for_more_information
(
"
#{
gitlab_shell_path
}
/bin/create-hooks"
)
fix_and_rerun
next
end
if
File
.
lstat
(
project_hook_file
).
symlink?
&&
File
.
realpath
(
project_hook_file
)
==
File
.
realpath
(
gitlab_shell_hook_file
)
puts
"ok"
.
green
else
puts
"not a link to GitLab Shell's hook"
.
red
try_fixing_it
(
"sudo -u
#{
gitlab_shell_ssh_user
}
ln -sf
#{
gitlab_shell_hook_file
}
#{
project_hook_file
}
"
)
for_more_information
(
"
#{
gitlab_shell_path
}
/bin/create-hooks"
)
fix_and_rerun
end
puts
"wrong or missing hooks"
.
red
try_fixing_it
(
sudo_gitlab
(
"
#{
gitlab_shell_path
}
/bin/create-hooks"
),
'Check the hooks_path in config/gitlab.yml'
,
'Check your gitlab-shell installation'
)
for_more_information
(
see_installation_guide_section
"GitLab Shell"
)
fix_and_rerun
end
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录