]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/stateofthemap/recipes/jekyll.rb
Remove tile per IP rate limiting
[chef.git] / cookbooks / stateofthemap / recipes / jekyll.rb
index e286f2f7cb4fb9915a9c324c88cd1432a47750a3..28744d615c0858a9f06e6f0156e26e16c670c7f8 100644 (file)
@@ -48,9 +48,7 @@ apache_module "rewrite"
     group "nogroup"
   end
 
-  # Workaround https://github.com/jekyll/jekyll/issues/7804
-  # by creating a .jekyll-cache folder
-  directory "/srv/#{year}.stateofthemap.org/.jekyll-cache" do
+  directory "/srv/#{year}.stateofthemap.org/vendor" do
     mode "755"
     owner "nobody"
     group "nogroup"
@@ -58,19 +56,25 @@ apache_module "rewrite"
 
   bundle_install "/srv/#{year}.stateofthemap.org" do
     action :nothing
-    options "--deployment --jobs #{node[:cpu][:total]}"
-    user "root"
-    group "root"
+    user "nobody"
+    group "nogroup"
+    environment "BUNDLE_FROZEN" => "true",
+                "BUNDLE_WITHOUT" => "development:test",
+                "BUNDLE_PATH" => "vendor/bundle",
+                "BUNDLE_DEPLOYMENT" => "1",
+                "BUNDLE_JOBS" => node.cpu_cores.to_s
     notifies :run, "bundle_exec[/srv/#{year}.stateofthemap.org]"
     only_if { ::File.exist?("/srv/#{year}.stateofthemap.org/Gemfile") }
   end
 
   bundle_exec "/srv/#{year}.stateofthemap.org" do
     action :nothing
-    command "jekyll build --trace --baseurl=https://#{year}.stateofthemap.org"
+    command "jekyll build --trace --disable-disk-cache --baseurl=https://#{year}.stateofthemap.org"
     user "nobody"
     group "nogroup"
-    environment "LANG" => "C.UTF-8"
+    environment "LANG" => "C.UTF-8",
+                "BUNDLE_PATH" => "vendor/bundle",
+                "BUNDLE_DEPLOYMENT" => "1"
   end
 
   ssl_certificate "#{year}.stateofthemap.org" do