]> git.openstreetmap.org Git - chef.git/blob - cookbooks/tile/templates/default/expire-tiles.xenial.erb
tile: add ruby package - used by expire-tile
[chef.git] / cookbooks / tile / templates / default / expire-tiles.xenial.erb
1 #!/usr/bin/ruby
2
3 # DO NOT EDIT - This file is being maintained by Chef
4
5 require 'expire'
6
7 tile_dirs = [
8 <% node[:tile][:styles].each do |name,details| -%>
9   "/srv/tile.openstreetmap.org/tiles/<%= name %>",
10 <% end -%>
11 ]
12
13 max_zoom = <%= node[:tile][:styles].collect { |n,d| d[:max_zoom] }.max %>
14
15 Dir.glob("/var/lib/replicate/expire-queue/changes-*.gz").each do |f|
16    Expire::expire(f, 13, max_zoom, tile_dirs)
17    File::unlink(f)
18 end