]> git.openstreetmap.org Git - chef.git/commitdiff
nominatim: add nightly updates for QA tiles
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 31 Aug 2021 12:35:33 +0000 (14:35 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 31 Aug 2021 12:35:33 +0000 (14:35 +0200)
cookbooks/nominatim/recipes/default.rb
cookbooks/nominatim/templates/default/updater.erb

index f13b21e1fdf4ee6c2fe195f7a5c85d42c05a1d9a..b7d7a803ed2ffbb93d3eed6a897830772ef3a812 100644 (file)
@@ -349,7 +349,9 @@ template "#{source_directory}/utils/nominatim-update" do
             :logfile => "#{node[:nominatim][:logdir]}/update.log",
             :branch => node[:nominatim][:revision],
             :update_stop_file => "#{basedir}/status/updates_disabled",
-            :update_maintenance_trigger => "#{basedir}/status/update_maintenance"
+            :update_maintenance_trigger => "#{basedir}/status/update_maintenance",
+            :qabindir => qa_bin_directory,
+            :qadatadir => qa_data_directory
 end
 
 template "/etc/init.d/nominatim-update" do
index cfa5de79b60e4d4eb127dbde9ae6bd41dd6a76c0..d3fd0d937d62aac5838ad8cce1c36d1027ca013a 100644 (file)
@@ -38,5 +38,16 @@ do
     if [ -f "<%= @update_maintenance_trigger %>" ]; then
         rm <%= @update_maintenance_trigger %>
         ./nominatim refresh --postcodes --threads 4 -v
+<% if node[:nominatim][:enable_qa_tiles] -%>
+        pushd <%= @qabindir %>
+        if python3 cli.py --execute-all; then
+          rm -rf "<%= @qadatadir %>/old"
+          if [ -d "<%= @qadatadir %>/current" ]; then
+            mv "<%= @qadatadir %>/current" "<%= @qadatadir %>/old"
+          fi
+          mv "<%= @qadatadir %>/new" "<%= @qadatadir %>/current"
+        fi
+        popd
+<% end -%>
     fi
 done