Commit c6b4060a authored by Matthieu Vachon's avatar Matthieu Vachon

Fixed foodcritic issues

parent 7693d12f
......@@ -6,14 +6,14 @@
gitlab = node['gitlab']
if gitlab['env'] == 'production'
cron 'gitlab_backups' do
action node['gitlab']['backup']['cron']['action']
minute node['gitlab']['backup']['cron']['minute']
hour node['gitlab']['backup']['cron']['hour']
user node['gitlab']['user']
mailto node['gitlab']['backup']['cron']['mailto']
path node['gitlab']['backup']['cron']['path']
command "cd #{gitlab['home']}/gitlab && bundle exec rake gitlab:backup:create RAILS_ENV=#{gitlab['env']}"
end
cron 'gitlab_backups' do
action node['gitlab']['backup']['cron']['action']
minute node['gitlab']['backup']['cron']['minute']
hour node['gitlab']['backup']['cron']['hour']
user node['gitlab']['user']
mailto node['gitlab']['backup']['cron']['mailto']
path node['gitlab']['backup']['cron']['path']
command "cd #{gitlab['home']}/gitlab && bundle exec rake gitlab:backup:create RAILS_ENV=#{gitlab['env']}"
only_if { gitlab['env'] == 'production' }
end
......@@ -19,8 +19,7 @@ template File.join(gitlab['shell_path'], "config.yml") do
:redis_host => gitlab['redis_host'],
:redis_port => gitlab['redis_port'],
:namespace => gitlab['namespace'],
:self_signed_cert => gitlab['self_signed_cert'],
:max_size => gitlab['max_size']
:self_signed_cert => gitlab['self_signed_cert']
})
end
......
......@@ -15,7 +15,6 @@ template File.join(gitlab['path'], 'config', 'gitlab.yml') do
:port => gitlab['port'],
:user => gitlab['user'],
:email_from => gitlab['email_from'],
:support_email => gitlab['support_email'],
:max_size => gitlab['max_size'],
:git_timeout => gitlab['git_timeout'],
:satellites_path => gitlab['satellites_path'],
......@@ -28,7 +27,6 @@ template File.join(gitlab['path'], 'config', 'gitlab.yml') do
:user_can_create_group => gitlab['user_can_create_group'],
:user_can_change_username => gitlab['user_can_change_username'],
:default_theme => gitlab['default_theme'],
:standard_signin_enabled => gitlab['standard_signin_enabled'],
:repository_downloads_path => gitlab['repository_downloads_path'],
:oauth_enabled => gitlab['oauth_enabled'],
:oauth_block_auto_created_users => gitlab['oauth_block_auto_created_users'],
......@@ -51,12 +49,14 @@ end
### Make sure GitLab can write to the log/ and tmp/ directories
### Create directories for sockets/pids
### Create public/uploads directory otherwise backup will fail
%w{log tmp tmp/pids tmp/sockets public/uploads}.each do |path|
directory File.join(gitlab['path'], path) do
%w{log tmp tmp/pids tmp/sockets public/uploads}.each do |folder|
path = File.join(gitlab['path'], folder)
directory path do
owner gitlab['user']
group gitlab['group']
mode 0755
not_if { File.exist?(File.join(gitlab['path'], path)) }
not_if { File.exist?(path) }
end
end
......@@ -260,22 +260,22 @@ when 'production'
end
end
if gitlab['aws']['enabled']
template "aws.yml" do
owner gitlab['user']
group gitlab['group']
path "#{gitlab['path']}/config/aws.yml"
mode 0755
variables({
:aws_access_key_id => gitlab['aws']['aws_access_key_id'],
:aws_secret_access_key => gitlab['aws']['aws_secret_access_key'],
:bucket => gitlab['aws']['bucket'],
:region => gitlab['aws']['region'],
:host => gitlab['aws']['host'],
:endpoint => gitlab['aws']['endpoint']
})
notifies :reload, "service[gitlab]"
end
template "aws.yml" do
owner gitlab['user']
group gitlab['group']
path "#{gitlab['path']}/config/aws.yml"
mode 0755
variables({
:aws_access_key_id => gitlab['aws']['aws_access_key_id'],
:aws_secret_access_key => gitlab['aws']['aws_secret_access_key'],
:bucket => gitlab['aws']['bucket'],
:region => gitlab['aws']['region'],
:host => gitlab['aws']['host'],
:endpoint => gitlab['aws']['endpoint']
})
notifies :reload, "service[gitlab]"
only_if { gitlab['aws']['enabled'] }
end
execute "rake assets:clean" do
......
......@@ -48,13 +48,13 @@ monit_monitrc "unicorn" do
end
disk_usage = monitrc['disk_usage']
if disk_usage['disk_percentage'] != "0"
monit_monitrc "disk_usage" do
variables ({
disk_percentage: disk_usage['disk_percentage'],
path: disk_usage['path']
})
end
monit_monitrc "disk_usage" do
variables ({
disk_percentage: disk_usage['disk_percentage'],
path: disk_usage['path']
})
only_if { disk_usage['disk_percentage'] != "0" }
end
directory "#{gitlab['path']}/bin" do
......
......@@ -20,7 +20,6 @@ template path do
:path => gitlab['path'],
:host => gitlab['host'],
:port => gitlab['port'],
:url => gitlab['url'],
:ssl_certificate_path => gitlab['ssl_certificate_path'],
:ssl_certificate_key_path => gitlab['ssl_certificate_key_path'],
:client_max_body_size => gitlab['client_max_body_size']
......@@ -48,12 +47,12 @@ else
end
if gitlab['port'] == "443"
directory "#{gitlab['ssl_certificate_path']}" do
directory gitlab['ssl_certificate_path'] do
recursive true
mode 0755
end
directory "#{gitlab['ssl_certificate_key_path']}" do
directory gitlab['ssl_certificate_key_path'] do
recursive true
mode 0755
end
......
......@@ -27,8 +27,7 @@ user gitlab['user'] do
end
# Locking user is not needed in development
if gitlab['env'] == 'production'
user gitlab['user'] do
action :lock
end
user gitlab['user'] do
action :lock
only_if { gitlab['env'] == 'production' }
end
......@@ -57,7 +57,7 @@ production: &base
## Standard login settings
# The standard login can be disabled to force login via LDAP
# default: true - If set to false, standard login form won't be shown on the sign-in page
signin_enabled: <%= @standard_signin_enabled %>
signin_enabled: <%= @signin_enabled %>
# Restrict setting visibility levels for non-admin users.
# The default is to allow all levels.
......
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