X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/b42a65b6a027b6b22c60080f1c112a93dc042ce3..feac0588239ee5b73140eb3b2625177e5529a743:/cookbooks/nominatim/templates/default/nominatim-update.erb diff --git a/cookbooks/nominatim/templates/default/nominatim-update.erb b/cookbooks/nominatim/templates/default/nominatim-update.erb index 145ae6a8c..470cb7d4a 100644 --- a/cookbooks/nominatim/templates/default/nominatim-update.erb +++ b/cookbooks/nominatim/templates/default/nominatim-update.erb @@ -6,22 +6,21 @@ date "+%c === Starting Nominatim update cycle" starttime=`date +%s` -<% if node[:nominatim][:enable_git_updates] -%> -if /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-source; then +EXTRA_PIP='--extra-index-url <%= node[:nominatim][:pip_index] %>' +# First update the importer and run the migrations. +if <%= @venvprefix %>pip list $EXTRA_PIP --outdated | fgrep -q nominatim-db; then + <%= @venvprefix %>pip install $EXTRA_PIP -U nominatim-db if ! /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-refresh-db; then date "+%c === Database refresh failed. Stopping updates." exit 1 fi - - pushd <%= @builddir %> - make install - -<% if node[:nominatim][:api_flavour] == "python" -%> +fi +# Then only attempt to update the frontend. +if <%= @venvprefix %>pip list $EXTRA_PIP --outdated | fgrep -q nominatim-api; then + <%= @venvprefix %>pip install $EXTRA_PIP -U nominatim-api systemctl reload nominatim -<% end -%> fi -<% end -%> if ! /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-data; then date "+%c === Data update failed. Stopping updates."