@@ -15,6 +15,7 @@ date=$(date '+%y%m%d_%H%M')
15
15
local_planetPBFFile=$VOLUME_DIR /planet-${date} .osm.pbf
16
16
cloud_planetPBFFile=planet/planet-${date} .osm.pbf
17
17
stateFile=" $VOLUME_DIR /state.txt"
18
+ dumpFile=" $VOLUME_DIR /input-latest.dump"
18
19
19
20
# If overwrite flag is enabled, use fixed filenames
20
21
if [ " $OVERWRITE_PLANET_FILE " == " true" ]; then
26
27
# Download db .dump file
27
28
# ===============================
28
29
download_dump_file () {
29
- local_dumpFile=" $VOLUME_DIR /input-latest.dump"
30
30
echo " Downloading db .dump file from cloud..."
31
-
32
31
if [ " $CLOUDPROVIDER " == " aws" ]; then
33
- aws s3 cp " $DUMP_CLOUD_URL " " $local_dumpFile "
32
+ if [[ " $DUMP_CLOUD_URL " == * .txt ]]; then
33
+ temp_txt=" $VOLUME_DIR /tmp_dump_url.txt"
34
+ aws s3 cp " $DUMP_CLOUD_URL " " $temp_txt "
35
+ first_line=$( head -n 1 " $temp_txt " )
36
+ aws s3 cp " $first_line " " $dumpFile "
37
+ else
38
+ aws s3 cp " $DUMP_CLOUD_URL " " $dumpFile "
39
+ fi
34
40
elif [ " $CLOUDPROVIDER " == " gcp" ]; then
35
- gsutil cp " $DUMP_CLOUD_URL " " $local_dumpFile "
41
+ gsutil cp " $DUMP_CLOUD_URL " " $dumpFile "
36
42
fi
37
43
}
38
44
45
+
39
46
# ===============================
40
47
# Upload planet + state
41
48
# ===============================
@@ -63,7 +70,7 @@ if [ "$PLANET_EXPORT_METHOD" == "planet-dump-ng" ]; then
63
70
download_dump_file
64
71
echo " Generating planet file with planet-dump-ng..."
65
72
planet-dump-ng \
66
- --dump-file " $VOLUME_DIR /input-latest.dump " \
73
+ --dump-file " $dumpFile " \
67
74
--pbf " $local_planetPBFFile "
68
75
elif [ " $PLANET_EXPORT_METHOD " == " osmosis" ]; then
69
76
echo " Generating planet file with osmosis..."
0 commit comments