提交 7121a58e 编写于 作者: D Dmitriy Zaporozhets

Advanced logging for post-receive worker

上级 f72dc7f7
......@@ -4,12 +4,22 @@ class PostReceive
sidekiq_options queue: :post_receive
def perform(repo_path, oldrev, newrev, ref, identifier)
repo_path.gsub!(Gitlab.config.gitolite.repos_path.to_s, "")
if repo_path.start_with?(Gitlab.config.gitolite.repos_path.to_s)
repo_path.gsub!(Gitlab.config.gitolite.repos_path.to_s, "")
else
Gitlab::GitLogger.error("POST-RECEIVE: Check gitlab.yml config for correct gitolite.repos_path variable. \"#{Gitlab.config.gitolite.repos_path}\" does not match \"#{repo_path}\"")
end
repo_path.gsub!(/.git$/, "")
repo_path.gsub!(/^\//, "")
project = Project.find_with_namespace(repo_path)
return false if project.nil?
if project.nil?
Gitlab::GitLogger.error("POST-RECEIVE: Triggered hook for non-existing project with full path \"#{repo_path} \"")
return false
end
# Ignore push from non-gitlab users
user = if identifier.eql? Gitlab.config.gitolite.admin_key
......
......@@ -106,7 +106,8 @@ backup:
## Gitolite settings
gitolite:
admin_uri: git@localhost:gitolite-admin
# repos_path must not be a symlink
# REPOS_PATH MUST NOT BE A SYMLINK!!!
repos_path: /home/git/repositories/
hooks_path: /home/git/.gitolite/hooks/
admin_key: gitlab
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册