diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-27 15:59:07 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-27 15:59:07 +1000 |
commit | dd0a8fe143b5c778c17c92496de513ae066dc04f (patch) | |
tree | f31e5d0f97de40dae96d97b4439778a7070a0ef4 /bin/upload.sh | |
parent | 6fc8dc4617916d57427a85478b4448e0684e3798 (diff) |
test upload to API dev server
Diffstat (limited to 'bin/upload.sh')
-rwxr-xr-x | bin/upload.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/bin/upload.sh b/bin/upload.sh new file mode 100755 index 0000000..2971026 --- /dev/null +++ b/bin/upload.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +set -e + +mkdir -p uploadLog + +IMPORT_DOC="https://wiki.openstreetmap.org/wiki/Imports/Vicmap_Address" + +i=0 +totalFiles=`ls -1 dist/candidates/newAddressWithoutConflicts/*.osm | wc -l` +for f in dist/candidates/newAddressWithoutConflicts/*.osm; do + i=$(($i + 1)) + + layerMessage="adding new addresses not found in OSM" + d=`dirname "$f"` + b=`basename "$f" .osm` + id=`echo "$b" | cut -d'_' -f1` + name=`echo "$b" | cut -d'_' -f2` + + echo "$i/$totalFiles $id: $name" + + echo " to osc" + ./upload/osm2change.py "$f" + + if [ ! -e "$d/$b.osc" ] ; then + echo "$d/$b.osc not found" + echo '$f' >> uploadLog/oscNotFound.txt + else + echo " upload" + ./upload/upload.py \ + -u 'vicmap_import' \ + -p "${OSM_DEV_PASSWORD}" \ + -c yes \ + -m "Vicmap Import $layerMessage: $name. See $IMPORT_DOC" \ + -y 'Vicmap Address' \ + "$d/$b.osc" + echo "$f" >> uploadLog/uploaded.txt + fi + + # give the api a rest + sleep 1s + + # stop after first, used during testing + exit +done |