Commit b9f8b4019073fe60515bda8947d9040b4b73ea38
Exists in
master
and in
4 other branches
Merge pull request #2971 from yuters/patch-1
Some fix for gitlab:gitlab_shell:check
Showing
1 changed file
with
15 additions
and
30 deletions
Show diff stats
lib/tasks/gitlab/check.rake
... | ... | @@ -311,7 +311,7 @@ namespace :gitlab do |
311 | 311 | "Remove \"-e \" so the line starts with PATH" |
312 | 312 | ) |
313 | 313 | for_more_information( |
314 | - see_installation_guide_section("Gitolite"), | |
314 | + see_installation_guide_section("Gitlab Shell"), | |
315 | 315 | "https://github.com/gitlabhq/gitlabhq/issues/1059" |
316 | 316 | ) |
317 | 317 | fix_and_rerun |
... | ... | @@ -368,10 +368,10 @@ namespace :gitlab do |
368 | 368 | |
369 | 369 | |
370 | 370 | namespace :gitlab_shell do |
371 | - desc "GITLAB | Check the configuration of Gitolite" | |
371 | + desc "GITLAB | Check the configuration of Gitlab Shell" | |
372 | 372 | task check: :environment do |
373 | 373 | warn_user_is_not_gitlab |
374 | - start_checking "Gitolite" | |
374 | + start_checking "Gitlab Shell" | |
375 | 375 | |
376 | 376 | check_repo_base_exists |
377 | 377 | check_repo_base_is_not_symlink |
... | ... | @@ -380,7 +380,7 @@ namespace :gitlab do |
380 | 380 | check_post_receive_hook_is_up_to_date |
381 | 381 | check_repos_post_receive_hooks_is_link |
382 | 382 | |
383 | - finished_checking "Gitolite" | |
383 | + finished_checking "Gitlab Shell" | |
384 | 384 | end |
385 | 385 | |
386 | 386 | |
... | ... | @@ -392,7 +392,7 @@ namespace :gitlab do |
392 | 392 | print "post-receive hook up-to-date? ... " |
393 | 393 | |
394 | 394 | hook_file = "post-receive" |
395 | - gitlab_shell_hooks_path = File.join(Gitlab.config.gitlab_shell.hooks_path, "common") | |
395 | + gitlab_shell_hooks_path = Gitlab.config.gitlab_shell.hooks_path | |
396 | 396 | gitlab_shell_hook_file = File.join(gitlab_shell_hooks_path, hook_file) |
397 | 397 | gitlab_shell_ssh_user = Gitlab.config.gitlab_shell.ssh_user |
398 | 398 | |
... | ... | @@ -401,22 +401,7 @@ namespace :gitlab do |
401 | 401 | return |
402 | 402 | end |
403 | 403 | |
404 | - gitlab_shell_hook_content = File.read(gitlab_shell_hook_file) | |
405 | - gitlab_hook_file = Rails.root.join.join("lib", "hooks", hook_file) | |
406 | - gitlab_hook_content = File.read(gitlab_hook_file) | |
407 | - | |
408 | - if gitlab_shell_hook_content == gitlab_hook_content | |
409 | - puts "yes".green | |
410 | - else | |
411 | - puts "no".red | |
412 | - try_fixing_it( | |
413 | - "sudo -u #{gitlab_shell_ssh_user} cp #{gitlab_hook_file} #{gitlab_shell_hook_file}" | |
414 | - ) | |
415 | - for_more_information( | |
416 | - see_installation_guide_section "Setup GitLab Hooks" | |
417 | - ) | |
418 | - fix_and_rerun | |
419 | - end | |
404 | + puts "yes".green | |
420 | 405 | end |
421 | 406 | |
422 | 407 | def check_repo_base_exists |
... | ... | @@ -430,12 +415,12 @@ namespace :gitlab do |
430 | 415 | puts "no".red |
431 | 416 | puts "#{repo_base_path} is missing".red |
432 | 417 | try_fixing_it( |
433 | - "This should have been created when setting up Gitolite.", | |
418 | + "This should have been created when setting up Gitlab Shell.", | |
434 | 419 | "Make sure it's set correctly in config/gitlab.yml", |
435 | - "Make sure Gitolite is installed correctly." | |
420 | + "Make sure Gitlab Shell is installed correctly." | |
436 | 421 | ) |
437 | 422 | for_more_information( |
438 | - see_installation_guide_section "Gitolite" | |
423 | + see_installation_guide_section "Gitlab Shell" | |
439 | 424 | ) |
440 | 425 | fix_and_rerun |
441 | 426 | end |
... | ... | @@ -480,7 +465,7 @@ namespace :gitlab do |
480 | 465 | "find #{repo_base_path} -type d -print0 | sudo xargs -0 chmod g+s" |
481 | 466 | ) |
482 | 467 | for_more_information( |
483 | - see_installation_guide_section "Gitolite" | |
468 | + see_installation_guide_section "Gitlab Shell" | |
484 | 469 | ) |
485 | 470 | fix_and_rerun |
486 | 471 | end |
... | ... | @@ -506,7 +491,7 @@ namespace :gitlab do |
506 | 491 | "sudo chown -R #{gitlab_shell_ssh_user}:#{gitlab_shell_owner_group} #{repo_base_path}" |
507 | 492 | ) |
508 | 493 | for_more_information( |
509 | - see_installation_guide_section "Gitolite" | |
494 | + see_installation_guide_section "Gitlab Shell" | |
510 | 495 | ) |
511 | 496 | fix_and_rerun |
512 | 497 | end |
... | ... | @@ -516,7 +501,7 @@ namespace :gitlab do |
516 | 501 | print "post-receive hooks in repos are links: ... " |
517 | 502 | |
518 | 503 | hook_file = "post-receive" |
519 | - gitlab_shell_hooks_path = File.join(Gitlab.config.gitlab_shell.hooks_path, "common") | |
504 | + gitlab_shell_hooks_path = Gitlab.config.gitlab_shell.hooks_path | |
520 | 505 | gitlab_shell_hook_file = File.join(gitlab_shell_hooks_path, hook_file) |
521 | 506 | gitlab_shell_ssh_user = Gitlab.config.gitlab_shell.ssh_user |
522 | 507 | |
... | ... | @@ -545,7 +530,7 @@ namespace :gitlab do |
545 | 530 | "sudo -u #{gitlab_shell_ssh_user} ln -sf #{gitlab_shell_hook_file} #{project_hook_file}" |
546 | 531 | ) |
547 | 532 | for_more_information( |
548 | - "lib/support/rewrite-hooks.sh" | |
533 | + "#{gitlab_shell_user_home}/gitlab-shell/support/rewrite-hooks.sh" | |
549 | 534 | ) |
550 | 535 | fix_and_rerun |
551 | 536 | next |
... | ... | @@ -555,7 +540,7 @@ namespace :gitlab do |
555 | 540 | File.realpath(project_hook_file) == File.realpath(gitlab_shell_hook_file) |
556 | 541 | puts "ok".green |
557 | 542 | else |
558 | - puts "not a link to Gitolite's hook".red | |
543 | + puts "not a link to Gitlab Shell's hook".red | |
559 | 544 | try_fixing_it( |
560 | 545 | "sudo -u #{gitlab_shell_ssh_user} ln -sf #{gitlab_shell_hook_file} #{project_hook_file}" |
561 | 546 | ) |
... | ... | @@ -577,7 +562,7 @@ namespace :gitlab do |
577 | 562 | end |
578 | 563 | |
579 | 564 | def gitlab_shell_version |
580 | - gitlab_shell_version_file = "#{gitlab_shell_user_home}/gitlab_shell/src/VERSION" | |
565 | + gitlab_shell_version_file = "#{gitlab_shell_user_home}/gitlab-shell/VERSION" | |
581 | 566 | if File.readable?(gitlab_shell_version_file) |
582 | 567 | File.read(gitlab_shell_version_file) |
583 | 568 | end | ... | ... |