]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/web/resources/rails_port.rb
Ensure make is installed got building ruby extensions
[chef.git] / cookbooks / web / resources / rails_port.rb
index 6d39b937b8c5d07b60cbd7330aeee120784e3853..ba3f06aaade7928d232a54b74a0a6e9e038c207a 100644 (file)
@@ -73,6 +73,7 @@ property :diary_feed_delay, Integer
 property :storage_configuration, Hash, :default => {}
 property :storage_service, String, :default => "local"
 property :storage_url, String
+property :tile_cdn_url, String
 
 action :create do
   package %W[
@@ -80,12 +81,12 @@ action :create do
     ruby#{new_resource.ruby}-dev
     imagemagick
     nodejs
-    geoip-database
     tzdata
   ]
 
   package %w[
     g++
+    make
     pkg-config
     libpq-dev
     libsasl2-dev
@@ -181,7 +182,6 @@ action :create do
 
     line.gsub!(/^( *)#geonames_username:.*$/, "\\1geonames_username: \"openstreetmap\"")
 
-    line.gsub!(/^( *)#geoip_database:.*$/, "\\1geoip_database: \"/usr/share/GeoIP/GeoIPv6.dat\"")
     line.gsub!(/^( *)#maxmind_database:.*$/, "\\1maxmind_database: \"/usr/share/GeoIP/GeoLite2-Country.mmdb\"")
 
     if new_resource.gpx_dir
@@ -320,14 +320,14 @@ action :create do
     "trace_use_job_queue",
     "diary_feed_delay",
     "storage_service",
-    "storage_url"
+    "storage_url",
+    "tile_cdn_url"
   ).reject { |_k, v| v.nil? }.merge(
     "server_protocol" => "https",
     "server_url" => new_resource.site,
     "support_email" => "support@openstreetmap.org",
     "email_return_path" => "bounces@openstreetmap.org",
     "geonames_username" => "openstreetmap",
-    "geoip_database" => "/usr/share/GeoIP/GeoIPv6.dat",
     "maxmind_database" => "/usr/share/GeoIP/GeoLite2-Country.mmdb"
   )
 
@@ -405,7 +405,8 @@ action :create do
   execute "#{rails_directory}/package.json" do
     action :nothing
     command "bundle#{new_resource.ruby} exec rake yarn:install"
-    environment "RAILS_ENV" => "production"
+    environment "HOME" => rails_directory,
+                "RAILS_ENV" => "production"
     cwd rails_directory
     user new_resource.user
     group new_resource.group
@@ -416,7 +417,8 @@ action :create do
   execute "#{rails_directory}/app/assets/javascripts/i18n" do
     action :nothing
     command "bundle#{new_resource.ruby} exec rake i18n:js:export"
-    environment "RAILS_ENV" => "production"
+    environment "HOME" => rails_directory,
+                "RAILS_ENV" => "production"
     cwd rails_directory
     user new_resource.user
     group new_resource.group
@@ -427,7 +429,8 @@ action :create do
   execute "#{rails_directory}/public/assets" do
     action :nothing
     command "bundle#{new_resource.ruby} exec rake assets:precompile"
-    environment "RAILS_ENV" => "production"
+    environment "HOME" => rails_directory,
+                "RAILS_ENV" => "production"
     cwd rails_directory
     user new_resource.user
     group new_resource.group