From 7a88bf09782db5f6c2b22a0e16fbc9df1a2168eb Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 11 Feb 2013 09:58:02 +0200 Subject: [PATCH] Fix gitlab:check --- config/gitlab.yml.example | 2 +- lib/tasks/gitlab/check.rake | 64 ------------------------------------- 2 files changed, 1 insertion(+), 65 deletions(-) diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 02118cbd..8fb4deeb 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -107,7 +107,7 @@ backup: gitolite: # REPOS_PATH MUST NOT BE A SYMLINK!!! repos_path: /home/git/repositories/ - hooks_path: /home/git/.gitolite/hooks/ + hooks_path: /home/git/gitlab-shell/hooks/ admin_key: gitlab upload_pack: true receive_pack: true diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index 0d78b746..c07cdb96 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -377,10 +377,8 @@ namespace :gitlab do check_repo_base_is_not_symlink check_repo_base_user_and_group check_repo_base_permissions - check_post_receive_hook_exists check_post_receive_hook_is_up_to_date check_repos_post_receive_hooks_is_link - check_repos_git_config finished_checking "Gitolite" end @@ -389,29 +387,6 @@ namespace :gitlab do # Checks ######################## - def check_post_receive_hook_exists - print "post-receive hook exists? ... " - - hook_file = "post-receive" - gitolite_hooks_path = File.join(Gitlab.config.gitolite.hooks_path, "common") - gitolite_hook_file = File.join(gitolite_hooks_path, hook_file) - gitolite_ssh_user = Gitlab.config.gitolite.ssh_user - - gitlab_hook_file = Rails.root.join.join("lib", "hooks", hook_file) - - if File.exists?(gitolite_hook_file) - puts "yes".green - else - puts "no".red - try_fixing_it( - "sudo -u #{gitolite_ssh_user} cp #{gitlab_hook_file} #{gitolite_hook_file}" - ) - for_more_information( - see_installation_guide_section "Setup GitLab Hooks" - ) - fix_and_rerun - end - end def check_post_receive_hook_is_up_to_date print "post-receive hook up-to-date? ... " @@ -537,45 +512,6 @@ namespace :gitlab do end end - def check_repos_git_config - print "Git config in repos: ... " - - unless Project.count > 0 - puts "can't check, you have no projects".magenta - return - end - puts "" - - options = { - "core.sharedRepository" => "0660", - } - - Project.find_each(batch_size: 100) do |project| - print "#{project.name_with_namespace.yellow} ... " - - if project.empty_repo? - puts "repository is empty".magenta - else - correct_options = options.map do |name, value| - run("git --git-dir=\"#{project.repository.path_to_repo}\" config --get #{name}").try(:chomp) == value - end - - if correct_options.all? - puts "ok".green - else - puts "wrong or missing".red - try_fixing_it( - sudo_gitlab("bundle exec rake gitlab:gitolite:update_repos RAILS_ENV=production") - ) - for_more_information( - "doc/raketasks/maintenance.md" - ) - fix_and_rerun - end - end - end - end - def check_repos_post_receive_hooks_is_link print "post-receive hooks in repos are links: ... "