X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/4bfd3b66e6fc725fb406068a955bb3aeea394f90..4687a5bf9faa00f2ff3a14545cdd58a65a65ab8d:/cookbooks/web/definitions/rails_port.rb diff --git a/cookbooks/web/definitions/rails_port.rb b/cookbooks/web/definitions/rails_port.rb index f3d89d057..c23587dd9 100644 --- a/cookbooks/web/definitions/rails_port.rb +++ b/cookbooks/web/definitions/rails_port.rb @@ -72,7 +72,7 @@ define :rails_port, :action => [:create, :enable] do directory rails_directory do owner rails_user group rails_group - mode 02775 + mode 0o2775 end git rails_directory do @@ -102,7 +102,7 @@ define :rails_port, :action => [:create, :enable] do source "database.yml.erb" owner rails_user group rails_group - mode 0664 + mode 0o664 variables database_params notifies :run, "execute[#{rails_directory}]" end @@ -145,7 +145,7 @@ define :rails_port, :action => [:create, :enable] do end if params[:memcache_servers] - line.gsub!(/^( *)#memcache_servers:.*$/, "\\1memcache_servers: [ \"#{params[:memcache_servers].join("\", \"")}\" ]") + line.gsub!(/^( *)#memcache_servers:.*$/, "\\1memcache_servers: [ \"#{params[:memcache_servers].join('", "')}\" ]") end if params[:potlatch2_key] @@ -184,6 +184,11 @@ define :rails_port, :action => [:create, :enable] do line.gsub!(/^( *)#windowslive_auth_secret:.*$/, "\\1windowslive_auth_secret: \"#{params[:windowslive_auth_secret]}\"") end + if params[:github_auth_id] + line.gsub!(/^( *)#github_auth_id:.*$/, "\\1github_auth_id: \"#{params[:github_auth_id]}\"") + line.gsub!(/^( *)#github_auth_secret:.*$/, "\\1github_auth_secret: \"#{params[:github_auth_secret]}\"") + end + if params[:mapquest_key] line.gsub!(/^( *)#mapquest_key:.*$/, "\\1mapquest_key: \"#{params[:mapquest_key]}\"") end @@ -201,7 +206,7 @@ define :rails_port, :action => [:create, :enable] do file "#{rails_directory}/config/application.yml" do owner rails_user group rails_group - mode 0664 + mode 0o664 content application_yml notifies :run, "execute[#{rails_directory}/public/assets]" end @@ -210,7 +215,7 @@ define :rails_port, :action => [:create, :enable] do file "#{rails_directory}/config/piwik.yml" do owner rails_user group rails_group - mode 0664 + mode 0o664 content YAML.dump(params[:piwik_configuration]) notifies :run, "execute[#{rails_directory}/public/assets]" end @@ -234,7 +239,7 @@ define :rails_port, :action => [:create, :enable] do execute "#{rails_directory}/db/migrate" do action :nothing - command "bundle#{ruby_version} exec rake#{ruby_version} db:migrate" + command "bundle#{ruby_version} exec rake db:migrate" cwd rails_directory user rails_user group rails_group @@ -245,7 +250,7 @@ define :rails_port, :action => [:create, :enable] do execute "#{rails_directory}/public/assets" do action :nothing - command "bundle#{ruby_version} exec rake#{ruby_version} assets:precompile" + command "bundle#{ruby_version} exec rake assets:precompile" environment "RAILS_ENV" => "production" cwd rails_directory user rails_user @@ -292,7 +297,7 @@ define :rails_port, :action => [:create, :enable] do source "rails.cron.erb" owner "root" group "root" - mode 0755 + mode 0o755 variables :directory => rails_directory end end