]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/stateofthemap/recipes/jekyll.rb
sotm: Remove one-off permission fix
[chef.git] / cookbooks / stateofthemap / recipes / jekyll.rb
index a9dd65c8d08b42237725a8a0d3f88e25012ddf45..7b852b62f92a7d99659d548dd3b4837ecadf3be1 100644 (file)
@@ -17,6 +17,7 @@
 # limitations under the License.
 #
 
+include_recipe "stateofthemap"
 include_recipe "ruby"
 
 package %w[
@@ -47,29 +48,27 @@ 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
-    mode "755"
-    owner "nobody"
-    group "nogroup"
-  end
-
   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