Merge branch 'add_option_to_disable_gitlab_rails' into 'master'
Add option to disable gitlab rails Closes #326 See merge request !339
This commit is contained in:
commit
a784851e26
|
@ -44,6 +44,7 @@ default['gitlab']['user']['git_user_email'] = "gitlab@#{node['fqdn']}"
|
|||
####
|
||||
# GitLab Rails app
|
||||
####
|
||||
default['gitlab']['gitlab-rails']['enable'] = true
|
||||
default['gitlab']['gitlab-rails']['dir'] = "/var/opt/gitlab/gitlab-rails"
|
||||
default['gitlab']['gitlab-rails']['log_directory'] = "/var/log/gitlab/gitlab-rails"
|
||||
default['gitlab']['gitlab-rails']['environment'] = 'production'
|
||||
|
|
|
@ -198,7 +198,7 @@ module Gitlab
|
|||
next
|
||||
end
|
||||
|
||||
better_value_from_gitlab_rb = Gitlab[right.first][right.last]
|
||||
better_value_from_gitlab_rb = Gitlab[right.first][right.last]
|
||||
default_from_attributes = node['gitlab'][right.first.gsub('_', '-')][right.last]
|
||||
Gitlab[left.first][left.last] = better_value_from_gitlab_rb || default_from_attributes
|
||||
end
|
||||
|
|
|
@ -59,11 +59,18 @@ template "/opt/gitlab/embedded/etc/gitconfig" do
|
|||
variables gitconfig: node['gitlab']['omnibus-gitconfig']['system']
|
||||
end
|
||||
|
||||
include_recipe "gitlab::users"
|
||||
include_recipe "gitlab::web-server"
|
||||
include_recipe "gitlab::gitlab-shell"
|
||||
include_recipe "gitlab::gitlab-rails"
|
||||
include_recipe "gitlab::gitlab-ci" if node['gitlab']['gitlab-ci']['enable']
|
||||
|
||||
if node['gitlab']['gitlab-rails']['enable']
|
||||
include_recipe "gitlab::users"
|
||||
include_recipe "gitlab::gitlab-shell"
|
||||
include_recipe "gitlab::gitlab-rails"
|
||||
end
|
||||
|
||||
if node['gitlab']['gitlab-ci']['enable']
|
||||
include_recipe "gitlab::gitlab-ci"
|
||||
end
|
||||
|
||||
include_recipe "gitlab::selinux"
|
||||
include_recipe "gitlab::cron"
|
||||
|
||||
|
|
|
@ -39,9 +39,32 @@ link File.join(nginx_dir, "logs") do
|
|||
end
|
||||
|
||||
nginx_config = File.join(nginx_conf_dir, "nginx.conf")
|
||||
|
||||
gitlab_rails_http_conf = File.join(nginx_conf_dir, "gitlab-http.conf")
|
||||
gitlab_ci_http_conf = File.join(nginx_conf_dir, "gitlab-ci-http.conf")
|
||||
|
||||
# If the service is enabled, check if we are using internal nginx
|
||||
gitlab_rails_enabled = if node['gitlab']['gitlab-rails']['enable']
|
||||
node['gitlab']['nginx']['enable']
|
||||
else
|
||||
false
|
||||
end
|
||||
|
||||
gitlab_ci_enabled = if node['gitlab']['gitlab-ci']['enable']
|
||||
node['gitlab']['ci-nginx']['enable']
|
||||
else
|
||||
false
|
||||
end
|
||||
|
||||
# Include the config file for gitlab-rails in nginx.conf later
|
||||
nginx_vars = node['gitlab']['nginx'].to_hash.merge({
|
||||
:gitlab_http_config => File.join(nginx_conf_dir, "gitlab-http.conf")
|
||||
})
|
||||
:gitlab_http_config => gitlab_rails_enabled ? gitlab_rails_http_conf : nil
|
||||
})
|
||||
|
||||
# Include the config file for gitlab-ci in nginx.conf later
|
||||
nginx_vars = nginx_vars.merge!(
|
||||
:gitlab_ci_http_config => gitlab_ci_enabled ? gitlab_ci_http_conf : nil
|
||||
)
|
||||
|
||||
gitlab_port = node['gitlab']['gitlab-rails']['gitlab_port']
|
||||
|
||||
|
@ -57,7 +80,7 @@ else
|
|||
nginx_vars['https'] = nginx_vars['listen_https']
|
||||
end
|
||||
|
||||
template nginx_vars[:gitlab_http_config] do
|
||||
template gitlab_rails_http_conf do
|
||||
source "nginx-gitlab-http.conf.erb"
|
||||
owner "root"
|
||||
group "root"
|
||||
|
@ -70,30 +93,26 @@ template nginx_vars[:gitlab_http_config] do
|
|||
}
|
||||
))
|
||||
notifies :restart, 'service[nginx]' if OmnibusHelper.should_notify?("nginx")
|
||||
action gitlab_rails_enabled ? :create : :delete
|
||||
end
|
||||
|
||||
if node['gitlab']['ci-nginx']['enable']
|
||||
# Include the config file for gitlab-ci in nginx.conf later
|
||||
nginx_vars.merge!(
|
||||
:gitlab_ci_http_config => File.join(nginx_conf_dir, "gitlab-ci-http.conf")
|
||||
)
|
||||
ci_nginx_vars = node['gitlab']['ci-nginx']
|
||||
|
||||
ci_nginx_vars = node['gitlab']['ci-nginx']
|
||||
template nginx_vars[:gitlab_ci_http_config] do
|
||||
source "nginx-gitlab-ci-http.conf.erb"
|
||||
owner "root"
|
||||
group "root"
|
||||
mode "0644"
|
||||
variables(ci_nginx_vars.merge(
|
||||
{
|
||||
:fqdn => node['gitlab']['gitlab-ci']['gitlab_ci_host'],
|
||||
:https => node['gitlab']['gitlab-ci']['gitlab_ci_https'],
|
||||
:socket => node['gitlab']['ci-unicorn']['socket'],
|
||||
:port => node['gitlab']['gitlab-ci']['gitlab_ci_port'],
|
||||
}
|
||||
))
|
||||
notifies :restart, 'service[nginx]' if OmnibusHelper.should_notify?("nginx")
|
||||
end
|
||||
template gitlab_ci_http_conf do
|
||||
source "nginx-gitlab-ci-http.conf.erb"
|
||||
owner "root"
|
||||
group "root"
|
||||
mode "0644"
|
||||
variables(ci_nginx_vars.merge(
|
||||
{
|
||||
:fqdn => node['gitlab']['gitlab-ci']['gitlab_ci_host'],
|
||||
:https => node['gitlab']['gitlab-ci']['gitlab_ci_https'],
|
||||
:socket => node['gitlab']['ci-unicorn']['socket'],
|
||||
:port => node['gitlab']['gitlab-ci']['gitlab_ci_port'],
|
||||
}
|
||||
))
|
||||
notifies :restart, 'service[nginx]' if OmnibusHelper.should_notify?("nginx")
|
||||
action gitlab_ci_enabled ? :create : :delete
|
||||
end
|
||||
|
||||
template nginx_config do
|
||||
|
|
|
@ -151,9 +151,11 @@ bin_dir = "/opt/gitlab/embedded/bin"
|
|||
database_name = node['gitlab']['gitlab-rails']['db_database']
|
||||
ci_database_name = node['gitlab']['gitlab-ci']['db_database']
|
||||
|
||||
databases = [
|
||||
['gitlab-rails', database_name, node['gitlab']['postgresql']['sql_user']]
|
||||
]
|
||||
databases = []
|
||||
if node['gitlab']['gitlab-rails']['enable']
|
||||
databases << ['gitlab-rails', database_name, node['gitlab']['postgresql']['sql_user']]
|
||||
end
|
||||
|
||||
if node['gitlab']['gitlab-ci']['enable']
|
||||
databases << ['gitlab-ci', ci_database_name, node['gitlab']['postgresql']['sql_ci_user']]
|
||||
end
|
||||
|
|
|
@ -28,7 +28,10 @@ http {
|
|||
|
||||
include /opt/gitlab/embedded/conf/mime.types;
|
||||
|
||||
<% if @gitlab_http_config %>
|
||||
include <%= @gitlab_http_config %>;
|
||||
<% end %>
|
||||
|
||||
<% if @gitlab_ci_http_config %>
|
||||
include <%= @gitlab_ci_http_config %>;
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue