X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/0fd66a3f0f75fd01d6d5a22570e9557158630e5a..aaae8786e4a31b526550a19fae896238e9bfd702:/cookbooks/stateofthemap/recipes/jekyll.rb diff --git a/cookbooks/stateofthemap/recipes/jekyll.rb b/cookbooks/stateofthemap/recipes/jekyll.rb index a9dd65c8d..7b852b62f 100644 --- a/cookbooks/stateofthemap/recipes/jekyll.rb +++ b/cookbooks/stateofthemap/recipes/jekyll.rb @@ -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