-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
75 lines (56 loc) · 2.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.DEFAULT_GOAL := setup
.PHONY: build bundle-app compile-app app-server api-server app-console \
api-console assembly compile server setup restart ingest-assembly ingest \
compile-ingest download-tif
build:
docker-compose -f docker-compose.yml run --rm --no-deps app yarn
bundle-app:
bash -c "trap 'cd ..' EXIT; cd app; npm install; npm run bundle"
compile-api:
bash -c "trap 'cd ..' EXIT; cd api; sbt compile"
app-server:
docker-compose up -d app
api-server:
bash -c "trap 'cd ..' EXIT; cd api; sbt ~reStart"
app-console:
docker-compose exec app /bin/bash
api-console:
bash -c "trap 'cd ..' EXIT; cd api; sbt console"
assembly:
bash -c "trap 'cd ..' EXIT; cd api; sbt assembly"
compile: bundle-app compile-api compile-ingest
restart: api-server
server: app-server api-server
setup: build paint
download-tif:
ifeq (,$(wildcard ./ingest/land-cover-data/geotiff/nlcd_pa.tif))
curl -o ./ingest/land-cover-data/geotiff/nlcd_pa.tif \
https://azavea-research-public-data.s3.amazonaws.com/geotrellis/samples/nlcd_pa.tif
endif
ingest-assembly:
bash -c "trap 'cd ..' EXIT; cd ingest; sbt assembly"
compile-ingest:
bash -c "trap 'cd ..' EXIT; cd ingest; sbt compile"
ingest: ingest-assembly download-tif
ifeq (,$(wildcard ./ingest/land-cover-data/catalog/attributes/nlcd-pennsylvania__.__0__.__metadata.json))
bash -c "trap 'cd ..' EXIT; cd ingest; spark-submit \
--name \"NLCDPA Ingest\" \
--master \"local[*]\" \
--driver-memory 4G \
--class LandCoverIngest \
target/scala-2.11/geotrellis_collections_api_ingest-assembly-2.0.jar"
endif
paint: ingest
ifeq (,$(wildcard ./ingest/land-cover-data/tiles/nlcd-pennsylvania/0/0/0.png))
bash -c "trap 'cd ..' EXIT; cd ingest; spark-submit \
--name \"Paint PA Land Cover Tiles\" \
--master \"local[*]\" \
--driver-memory 4G \
--class LandCoverPaint \
target/scala-2.11/geotrellis_collections_api_ingest-assembly-2.0.jar"
endif
clean:
bash -c "trap 'cd ..' EXIT; cd ingest; \
rm -f land-cover-data/geotiff/nlcd_pa.tif; \
rm -rf land-cover-data/catalog/*; \
rm -rf land-cover-data/tiles/*"