Commit 9f940aeaf4fbfed2906900dda81b1f6b5a0656a6
1 parent
8918d113
Exists in
master
and in
4 other branches
Fix detecting Ruby version and Omniauth providers in gitlab:env:info task
Fixes #2245
Showing
1 changed file
with
7 additions
and
2 deletions
Show diff stats
lib/tasks/gitlab/info.rake
| ... | ... | @@ -16,6 +16,8 @@ namespace :gitlab do |
| 16 | 16 | |
| 17 | 17 | # check if there is an RVM environment |
| 18 | 18 | rvm_version = run_and_match("rvm --version", /[\d\.]+/).try(:to_s) |
| 19 | + # check Ruby version | |
| 20 | + ruby_version = run_and_match("ruby --version", /[\d\.p]+/).try(:to_s) | |
| 19 | 21 | # check Gem version |
| 20 | 22 | gem_version = run("gem --version") |
| 21 | 23 | # check Bundler version |
| ... | ... | @@ -29,7 +31,7 @@ namespace :gitlab do |
| 29 | 31 | puts "Current User:\t#{`whoami`}" |
| 30 | 32 | puts "Using RVM:\t#{rvm_version.present? ? "yes".green : "no"}" |
| 31 | 33 | puts "RVM Version:\t#{rvm_version}" if rvm_version.present? |
| 32 | - puts "Ruby Version:\t#{ENV['RUBY_VERSION'] || "unknown".red}" | |
| 34 | + puts "Ruby Version:\t#{ruby_version || "unknown".red}" | |
| 33 | 35 | puts "Gem Version:\t#{gem_version || "unknown".red}" |
| 34 | 36 | puts "Bundler Version:#{bunder_version || "unknown".red}" |
| 35 | 37 | puts "Rake Version:\t#{rake_version || "unknown".red}" |
| ... | ... | @@ -44,6 +46,9 @@ namespace :gitlab do |
| 44 | 46 | http_clone_url = project.http_url_to_repo |
| 45 | 47 | ssh_clone_url = project.ssh_url_to_repo |
| 46 | 48 | |
| 49 | + omniauth_providers = Gitlab.config.omniauth_providers | |
| 50 | + omniauth_providers.map! { |provider| provider['name'] } | |
| 51 | + | |
| 47 | 52 | puts "" |
| 48 | 53 | puts "GitLab information".yellow |
| 49 | 54 | puts "Version:\t#{Gitlab::Version}" |
| ... | ... | @@ -55,7 +60,7 @@ namespace :gitlab do |
| 55 | 60 | puts "SSH Clone URL:\t#{ssh_clone_url}" |
| 56 | 61 | puts "Using LDAP:\t#{Gitlab.config.ldap_enabled? ? "yes".green : "no"}" |
| 57 | 62 | puts "Using Omniauth:\t#{Gitlab.config.omniauth_enabled? ? "yes".green : "no"}" |
| 58 | - puts "Omniauth Providers:\t#{Gitlab.config.omniauth_providers}" if Gitlab.config.omniauth_enabled? | |
| 63 | + puts "Omniauth Providers: #{omniauth_providers.map(&:magenta).join(', ')}" if Gitlab.config.omniauth_enabled? | |
| 59 | 64 | |
| 60 | 65 | |
| 61 | 66 | ... | ... |