From: Sarah Hoffmann Date: Fri, 30 Sep 2016 19:12:34 +0000 (+0200) Subject: nominatim: run git update in source directory X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/5af95bd6e511c5b9f9e737b69b944fc00b60d42b?ds=sidebyside nominatim: run git update in source directory --- diff --git a/cookbooks/nominatim/recipes/base.rb b/cookbooks/nominatim/recipes/base.rb index 9a3252c72..242ada30d 100644 --- a/cookbooks/nominatim/recipes/base.rb +++ b/cookbooks/nominatim/recipes/base.rb @@ -196,6 +196,7 @@ template "#{source_directory}/utils/nominatim-update" do group "nominatim" mode 0o755 variables :bindir => source_directory, + :srcdir => source_directory, :logfile => "#{node[:nominatim][:logdir]}/update.log", :branch => node[:nominatim][:revision], :update_stop_file => "#{home_directory}/status/updates_disabled" diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index 2e5887b5a..f51547490 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -244,6 +244,7 @@ template "#{source_directory}/utils/nominatim-update" do group "nominatim" mode 0o755 variables :bindir => build_directory, + :srcdir => source_directory, :logfile => "#{node[:nominatim][:logdir]}/update.log", :branch => node[:nominatim][:revision], :update_stop_file => "#{basedir}/status/updates_disabled" diff --git a/cookbooks/nominatim/templates/default/updater.erb b/cookbooks/nominatim/templates/default/updater.erb index 5c5a4448b..8a3cf027e 100644 --- a/cookbooks/nominatim/templates/default/updater.erb +++ b/cookbooks/nominatim/templates/default/updater.erb @@ -13,12 +13,14 @@ do ./utils/update.php --no-npi --import-osmosis + pushd <%= @srcdir %> if git fetch origin; then # will trigger recompilation if necessary git merge origin/<%= @branch %> else echo "WARNING: git fetch failed." fi + popd # sleep a bit if updates take less than a minute endtime=`date +%s`