Commit 3a89624b 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 e2b2cfa0
...@@ -14,8 +14,12 @@ namespace :gitlab do ...@@ -14,8 +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 # check for system defined proxies
proxies = Gitlab::Proxy.detect_proxy.map {|k, v| "#{k}: #{v}"}.join("\n\t\t") 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
...@@ -24,7 +28,11 @@ namespace :gitlab do ...@@ -24,7 +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)}"
puts "Proxy:\t\t#{proxies.present? ? proxies.color(:green) : "no"}"
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?
...@@ -42,12 +50,14 @@ namespace :gitlab do ...@@ -42,12 +50,14 @@ 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
geo_node_type = if Gitlab.ee?
if Gitlab::Geo.current_node geo_node_type =
Gitlab::Geo.current_node.primary ? 'Primary' : 'Secondary' if Gitlab::Geo.current_node
else Gitlab::Geo.current_node.primary ? 'Primary' : 'Secondary'
'Undefined'.color(:red) else
end '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'] }
...@@ -61,9 +71,13 @@ namespace :gitlab do ...@@ -61,9 +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}"
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"}" if Gitlab.ee?
puts "Geo node:\t#{geo_node_type}" if Gitlab::Geo.enabled? 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