]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/nominatim/templates/default/updater.erb
nominatim: run git update in source directory
[chef.git] / cookbooks / nominatim / templates / default / updater.erb
index aba7f72aa9dea61a2281126b13dc2589be18d06f..8a3cf027edf4f2549a835e300d8e5d566afc8c49 100644 (file)
@@ -3,23 +3,24 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
 # Change to Nominatim directory
-DIR="$( cd "$( dirname "$0" )" && pwd )"
-cd $DIR/..
+cd <%= @bindir %>
 
 while [ ! -f "<%= @update_stop_file %>" ]
 do
     # Send output to the log (logrotatable)
-    exec >> /var/log/nominatim/update.log 2>&1
+    exec >> <%= @logfile %> 2>&1
     starttime=`date +%s`
 
     ./utils/update.php --no-npi --import-osmosis
 
+    pushd <%= @srcdir %>
     if git fetch origin; then
       # will trigger recompilation if necessary
-      git merge origin/master
+      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`