Commit f2c89c7c903b76e0a84385fa8d7761d28c2093a7

Authored by Riyad Preukschas
2 parents c3383216 b39aba73

Merge pull request #2194 from jojosch/rake-info-task

add rake task to gather system information
doc/raketasks/maintenance.md
... ... @@ -11,6 +11,36 @@ bundle exec rake gitlab:app:setup
11 11 ```
12 12  
13 13  
  14 +### Gather Information about GitLab Installation
  15 +
  16 +This command gathers information about your GitLab installation. These can be used in issue reports.
  17 +
  18 +```
  19 +bundle exec rake gitlab:app:info
  20 +```
  21 +
  22 +Example output:
  23 +
  24 +```
  25 +Gitlab information
  26 +Version: 4.0.0pre
  27 +Resivion: 8022628
  28 +
  29 +System information
  30 +System: Debian6.0.6
  31 +Home: /home/gitlab
  32 +User: gitlab
  33 +Ruby: ruby-1.9.3-p286
  34 +Gems: 1.8.24
  35 +
  36 +Gitolite information
  37 +Version: v3.04-4-g4524f01
  38 +Admin URI: git@localhost:gitolite-admin
  39 +Base Path: /home/git/repositories/
  40 +Hook Path: /home/git/.gitolite/hooks/
  41 +Git: /usr/bin/git
  42 +```
  43 +
14 44 ### Check GitLab installation status
15 45  
16 46 [Trouble-Shooting-Guide](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide)
... ...
lib/tasks/gitlab/info.rake 0 → 100644
... ... @@ -0,0 +1,48 @@
  1 +namespace :gitlab do
  2 + namespace :app do
  3 + desc "GITLAB | Get Information about this installation"
  4 + task :info => :environment do
  5 +
  6 + puts ""
  7 + puts "Gitlab information".yellow
  8 + puts "Version:\t#{Gitlab::Version}"
  9 + puts "Resivion:\t#{Gitlab::Revision}"
  10 +
  11 + # check which os is running
  12 + if Kernel.system('lsb_release > /dev/null 2>&1')
  13 + os_name = `lsb_release -irs`
  14 + elsif File.exists?('/etc/system-release') && File.readable?('/etc/system-release')
  15 + os_name = File.read('/etc/system-release')
  16 + elsif File.exists?('/etc/debian_version') && File.readable?('/etc/debian_version')
  17 + debian_version = File.read('/etc/debian_version')
  18 + os_name = "Debian #{debian_version}"
  19 + end
  20 + os_name = os_name.gsub(/\n/, '')
  21 +
  22 + # check gitolite version
  23 + gitolite_version_file = "#{Gitlab.config.git_base_path}/../gitolite/src/VERSION"
  24 + if File.exists?(gitolite_version_file) && File.readable?(gitolite_version_file)
  25 + gitolite_version = File.read(gitolite_version_file)
  26 + else
  27 + gitolite_version = 'unknown'
  28 + end
  29 +
  30 + puts ""
  31 + puts "System information".yellow
  32 + puts "System:\t\t#{os_name}"
  33 + puts "Home:\t\t#{ENV['HOME']}"
  34 + puts "User:\t\t#{ENV['LOGNAME']}"
  35 + puts "Ruby:\t\t#{ENV['RUBY_VERSION']}"
  36 + puts "Gems:\t\t#{`gem --version`}"
  37 +
  38 + puts ""
  39 + puts "Gitolite information".yellow
  40 + puts "Version:\t#{gitolite_version}"
  41 + puts "Admin URI:\t#{Gitlab.config.git_host.admin_uri}"
  42 + puts "Base Path:\t#{Gitlab.config.git_base_path}"
  43 + puts "Hook Path:\t#{Gitlab.config.git_hooks_path}"
  44 + puts "Git:\t\t#{Gitlab.config.git.path}"
  45 +
  46 + end
  47 + end
  48 +end
... ...