Commit a3c806732570bd38feb3204b1eadd1f70b21e266
Exists in
master
and in
4 other branches
Merge branch 'gitlab-shell-check' of /home/git/repositories/gitlab/gitlabhq
Showing
1 changed file
with
18 additions
and
0 deletions
Show diff stats
lib/tasks/gitlab/check.rake
@@ -376,6 +376,7 @@ namespace :gitlab do | @@ -376,6 +376,7 @@ namespace :gitlab do | ||
376 | check_repo_base_permissions | 376 | check_repo_base_permissions |
377 | check_update_hook_is_up_to_date | 377 | check_update_hook_is_up_to_date |
378 | check_repos_update_hooks_is_link | 378 | check_repos_update_hooks_is_link |
379 | + check_gitlab_shell_self_test | ||
379 | 380 | ||
380 | finished_checking "GitLab Shell" | 381 | finished_checking "GitLab Shell" |
381 | end | 382 | end |
@@ -552,6 +553,23 @@ namespace :gitlab do | @@ -552,6 +553,23 @@ namespace :gitlab do | ||
552 | end | 553 | end |
553 | end | 554 | end |
554 | 555 | ||
556 | + def check_gitlab_shell_self_test | ||
557 | + gitlab_shell_repo_base = File.expand_path('gitlab-shell', gitlab_shell_user_home) | ||
558 | + check_cmd = File.expand_path('bin/check', gitlab_shell_repo_base) | ||
559 | + puts "Running #{check_cmd}" | ||
560 | + if system(check_cmd, chdir: gitlab_shell_repo_base) | ||
561 | + puts 'gitlab-shell self-check successful'.green | ||
562 | + else | ||
563 | + puts 'gitlab-shell self-check failed'.red | ||
564 | + try_fixing_it( | ||
565 | + 'Make sure GitLab is running;', | ||
566 | + 'Check the gitlab-shell configuration file:', | ||
567 | + sudo_gitlab("editor #{File.expand_path('config.yml', gitlab_shell_repo_base)}") | ||
568 | + ) | ||
569 | + fix_and_rerun | ||
570 | + end | ||
571 | + end | ||
572 | + | ||
555 | 573 | ||
556 | # Helper methods | 574 | # Helper methods |
557 | ######################## | 575 | ######################## |