+ directory[:min_zoom].upto(directory[:max_zoom]) do |zoom|
+ directory "#{directory[:name]}/#{zoom}" do
+ owner "_renderd"
+ group "_renderd"
+ mode "755"
+ end
+
+ link "#{tile_directory}/#{zoom}" do
+ to "#{directory[:name]}/#{zoom}"
+ owner "tile"
+ group "tile"
+ end
+ end
+ end
+
+ file "#{tile_directory}/planet-import-complete" do
+ action :create_if_missing
+ owner "tile"
+ group "tile"
+ mode "444"
+ end
+
+ git style_directory do
+ action :sync
+ repository details[:repository]
+ revision details[:revision]
+ user "tile"
+ group "tile"
+ end
+
+ link "#{style_directory}/data" do
+ to "/srv/tile.openstreetmap.org/data"
+ owner "tile"
+ group "tile"
+ end
+
+ if details[:fonts_script]
+ execute details[:fonts_script] do
+ action :nothing
+ command details[:fonts_script]
+ cwd style_directory
+ user "tile"
+ group "tile"
+ subscribes :run, "git[#{style_directory}]"
+ end
+ end
+
+ if details[:functions_script]
+ postgresql_execute details[:functions_script] do
+ action :nothing
+ command details[:functions_script]
+ cluster node[:tile][:database][:cluster]
+ database "gis"
+ user "tile"
+ group "tile"
+ subscribes :run, "git[#{style_directory}]"
+ end
+ end
+
+ execute "#{style_directory}/project.mml" do
+ action :nothing
+ command "carto -a 3.0.22 project.mml > project.xml"
+ cwd style_directory
+ user "tile"
+ group "tile"
+ subscribes :run, "git[#{style_directory}]"
+ notifies :restart, "service[renderd]", :immediately
+ notifies :restart, "service[update-lowzoom@#{name}]"
+ end