Skip to content

Commit 9e6330c

Browse files
authored
Merge pull request #73 from nycmeshnet/james/fail_for_few_objects
Fail the data update (build) if too few objects are returned from meshdb
2 parents f3bc5d6 + ef363ab commit 9e6330c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/data/update.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@ set -e
77

88
curl -s -f -L -o kiosks.new.json "https://$MESHDB_HOST/api/v1/mapdata/kiosks/?format=json"
99
jq . kiosks.new.json
10+
if [ "$(jq length kiosks.new.json)" -lt "5" ]; then echo "Kiosk list too small"; exit 1; fi
1011
mv kiosks.new.json kiosks.json
1112

1213
curl -s -f -L -o nodes.new.json "https://$MESHDB_HOST/api/v1/mapdata/nodes/?format=json"
1314
jq . nodes.new.json
15+
if [ "$(jq length nodes.new.json)" -lt "5" ]; then echo "Node list too small"; exit 1; fi
1416
mv nodes.new.json nodes.json
1517

1618
curl -s -f -L -o links.new.json "https://$MESHDB_HOST/api/v1/mapdata/links/?format=json"
1719
jq . links.new.json
20+
if [ "$(jq length links.new.json)" -lt "5" ]; then echo "Links list too small"; exit 1; fi
1821
mv links.new.json links.json
1922

2023
curl -s -f -L -o sectors.new.json "https://$MESHDB_HOST/api/v1/mapdata/sectors/?format=json"
2124
jq . sectors.new.json
25+
if [ "$(jq length sectors.new.json)" -lt "5" ]; then echo "Sectors list too small"; exit 1; fi
2226
mv sectors.new.json sectors.json
2327

0 commit comments

Comments
 (0)