Commit 1f4bc814 authored by Yorick Peterse's avatar Yorick Peterse

Backport EE changes to gitlab:env:info

This backports EE specific changes for the Rake task `gitlab:env:info`,
wrapping them in a conditional. There is no way to inject code in the
middle of a Rake task in EE, so unfortunately this is the best we can
do.
parent 784b1756
...@@ -14,6 +14,12 @@ namespace :gitlab do ...@@ -14,6 +14,12 @@ namespace :gitlab do
rake_version = run_and_match(%w(rake --version), /[\d\.]+/).try(:to_s) rake_version = run_and_match(%w(rake --version), /[\d\.]+/).try(:to_s)
# check redis version # check redis version
redis_version = run_and_match(%w(redis-cli --version), /redis-cli (\d+\.\d+\.\d+)/).to_a redis_version = run_and_match(%w(redis-cli --version), /redis-cli (\d+\.\d+\.\d+)/).to_a
# check for system defined proxies
if Gitlab.ee?
proxies = Gitlab::Proxy.detect_proxy.map {|k, v| "#{k}: #{v}"}.join("\n\t\t")
end
# check Git version # check Git version
git_version = run_and_match([Gitlab.config.git.bin_path, '--version'], /git version ([\d\.]+)/).to_a git_version = run_and_match([Gitlab.config.git.bin_path, '--version'], /git version ([\d\.]+)/).to_a
# check Go version # check Go version
...@@ -22,6 +28,11 @@ namespace :gitlab do ...@@ -22,6 +28,11 @@ namespace :gitlab do
puts "" puts ""
puts "System information".color(:yellow) puts "System information".color(:yellow)
puts "System:\t\t#{os_name || "unknown".color(:red)}" puts "System:\t\t#{os_name || "unknown".color(:red)}"
if Gitlab.ee?
puts "Proxy:\t\t#{proxies.present? ? proxies.color(:green) : "no"}"
end
puts "Current User:\t#{run_command(%w(whoami))}" puts "Current User:\t#{run_command(%w(whoami))}"
puts "Using RVM:\t#{rvm_version.present? ? "yes".color(:green) : "no"}" puts "Using RVM:\t#{rvm_version.present? ? "yes".color(:green) : "no"}"
puts "RVM Version:\t#{rvm_version}" if rvm_version.present? puts "RVM Version:\t#{rvm_version}" if rvm_version.present?
...@@ -39,6 +50,15 @@ namespace :gitlab do ...@@ -39,6 +50,15 @@ namespace :gitlab do
http_clone_url = project.http_url_to_repo http_clone_url = project.http_url_to_repo
ssh_clone_url = project.ssh_url_to_repo ssh_clone_url = project.ssh_url_to_repo
if Gitlab.ee?
geo_node_type =
if Gitlab::Geo.current_node
Gitlab::Geo.current_node.primary ? 'Primary' : 'Secondary'
else
'Undefined'.color(:red)
end
end
omniauth_providers = Gitlab.config.omniauth.providers.map { |provider| provider['name'] } omniauth_providers = Gitlab.config.omniauth.providers.map { |provider| provider['name'] }
puts "" puts ""
...@@ -51,6 +71,13 @@ namespace :gitlab do ...@@ -51,6 +71,13 @@ namespace :gitlab do
puts "URL:\t\t#{Gitlab.config.gitlab.url}" puts "URL:\t\t#{Gitlab.config.gitlab.url}"
puts "HTTP Clone URL:\t#{http_clone_url}" puts "HTTP Clone URL:\t#{http_clone_url}"
puts "SSH Clone URL:\t#{ssh_clone_url}" puts "SSH Clone URL:\t#{ssh_clone_url}"
if Gitlab.ee?
puts "Elasticsearch:\t#{Gitlab::CurrentSettings.current_application_settings.elasticsearch_indexing? ? "yes".color(:green) : "no"}"
puts "Geo:\t\t#{Gitlab::Geo.enabled? ? "yes".color(:green) : "no"}"
puts "Geo node:\t#{geo_node_type}" if Gitlab::Geo.enabled?
end
puts "Using LDAP:\t#{Gitlab.config.ldap.enabled ? "yes".color(:green) : "no"}" puts "Using LDAP:\t#{Gitlab.config.ldap.enabled ? "yes".color(:green) : "no"}"
puts "Using Omniauth:\t#{Gitlab::Auth.omniauth_enabled? ? "yes".color(:green) : "no"}" puts "Using Omniauth:\t#{Gitlab::Auth.omniauth_enabled? ? "yes".color(:green) : "no"}"
puts "Omniauth Providers: #{omniauth_providers.join(', ')}" if Gitlab::Auth.omniauth_enabled? puts "Omniauth Providers: #{omniauth_providers.join(', ')}" if Gitlab::Auth.omniauth_enabled?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment