-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (39 loc) · 1.02 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
csvurl := https://data.ny.gov/api/views/7sqk-ycpk/rows.csv?accessType=DOWNLOAD&bom=true&format=true&sorting=true
$(GOPATH)/bin/dep:
@curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
.PHONY: all
all: clean csv vendor build-ui
@docker-compose rm -fv
@docker-compose build
@HOST=$(HOST) docker-compose up
.PHONY: stop
stop:
@docker-compose stop; docker-compose rm -fv
vendor: $(GOPATH)/bin/dep
@dep ensure
.PHONY: csv
csv: quick-draw.csv
.PHONY: clean
clean:
@-rm -rf vendor quick-draw.csv ui/dist/spa
quick-draw.csv:
@curl -LSs "$(csvurl)" | awk -F, '{seen[$$1,$$2]++;seen[$$2,$$1]++}seen[$$1,$$2]==1 && seen[$$2,$$1]==1' > $@
.PHONY: start-postgres
start-postgres:
@docker-compose up -d
.PHONY: import-csv
import-csv: vendor csv
@go run . --import
.PHONY: serve
serve:
@go run . --serve
.PHONY: ui
ui:
@cd ui && quasar dev
.PHONY: build-ui
build-ui: ui/dist/spa
ui/dist/spa:
@cd ui && quasar build
.PHONY: makerange
makerange:
@/bin/bash -c 'for n in {1..80}; do printf %i, $$n; done'