]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/templates/default/replicate.erb
Run a monthly reindex of the smaller database tables
[chef.git] / cookbooks / tile / templates / default / replicate.erb
index 81fc66419e153fa5e4e7970bae7b816ff02c3553..ea0e100cf46e7fe14c423f4f8c3442e5a3208913 100644 (file)
@@ -12,9 +12,6 @@ function onexit {
     [ -f sequence-prev.txt ] && mv sequence-prev.txt sequence.txt
 }
 
     [ -f sequence-prev.txt ] && mv sequence-prev.txt sequence.txt
 }
 
-# Send output to the log
-exec > /var/log/tile/replicate.log 2>&1
-
 # Change to the replication state directory
 cd /var/lib/replicate
 
 # Change to the replication state directory
 cd /var/lib/replicate
 
@@ -31,7 +28,7 @@ do
     cp sequence.txt sequence-prev.txt
 
     # Fetch the next set of changes
     cp sequence.txt sequence-prev.txt
 
     # Fetch the next set of changes
-    pyosmium-get-changes --sequence-file=sequence.txt --outfile=${file}
+    pyosmium-get-changes --server=<%= node[:tile][:replication][:url] %> --sequence-file=sequence.txt --outfile=${file}
 
     # Save exit status
     status=$?
 
     # Save exit status
     status=$?
@@ -47,13 +44,20 @@ do
 
         # Apply the changes to the database
         osm2pgsql --database gis --slim --append --number-processes=1 \
 
         # Apply the changes to the database
         osm2pgsql --database gis --slim --append --number-processes=1 \
-<% if node[:tile][:node_file] -%>
-                  --flat-nodes=<%= node[:tile][:node_file] %> \
+<% if node[:tile][:database][:node_file] -%>
+                  --flat-nodes=<%= node[:tile][:database][:node_file] %> \
+<% end -%>
+<% if node[:tile][:database][:multi_geometry] -%>
+                  --multi-geometry \
+<% end -%>
+<% if node[:tile][:database][:hstore] -%>
+                  --hstore \
+<% end -%>
+<% if node[:tile][:database][:style_file] -%>
+                  --style=<%= node[:tile][:database][:style_file] %> \
 <% end -%>
 <% end -%>
-<% if node[:tile][:styles][:default][:revision] >= "v4.0.0" -%>
-                  --multi-geometry --hstore \
-                  --style=/srv/tile.openstreetmap.org/styles/default/openstreetmap-carto.style \
-                  --tag-transform-script=/srv/tile.openstreetmap.org/styles/default/openstreetmap-carto.lua \
+<% if node[:tile][:database][:tag_transform_script] -%>
+                  --tag-transform-script=<%= node[:tile][:database][:tag_transform_script] %> \
 <% end -%>
                   ${file}
 
 <% end -%>
                   ${file}