-
Notifications
You must be signed in to change notification settings - Fork 189
/
Makefile
69 lines (53 loc) · 1.92 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
export GO111MODULE=on
all: bin/benchmarker bin/benchmark-worker bin/payment bin/shipment
bin/benchmarker: cmd/bench/main.go bench/**/*.go
go build -o bin/benchmarker cmd/bench/main.go
bin/benchmark-worker: cmd/bench-worker/main.go
go build -o bin/benchmark-worker cmd/bench-worker/main.go
bin/payment: cmd/payment/main.go bench/server/*.go
go build -o bin/payment cmd/payment/main.go
bin/shipment: cmd/shipment/main.go bench/server/*.go
go build -o bin/shipment cmd/shipment/main.go
vet:
go vet ./...
errcheck:
errcheck ./...
staticcheck:
staticcheck -checks="all,-ST1000" ./...
clean:
rm -rf bin/*
init:
$(MAKE) setup-initial-image
$(MAKE) setup-bench-image
$(MAKE) setup-initial-data
$(MAKE) clean-zip
initial-data/result/initial.sql: initial-data/Dockerfile initial-data/*.tsv initial-data/*.pl
cd initial-data && \
docker build -t isucon9-qualify/initial-data . && \
docker run -v $(shell pwd)/initial-data/result:/opt/initial-data/result -v $(shell pwd)/initial-data/pwcache:/opt/initial-data/pwcache isucon9-qualify/initial-data
.PHONY: setup-initial-image
setup-initial-image:
cd webapp/public && \
curl -L -O https://github.com/isucon/isucon9-qualify/releases/download/v2/initial.zip && \
unzip -qq initial.zip && \
rm -rf upload && \
mv v3_initial_data upload
.PHONY: setup-bench-image
setup-bench-image:
cd initial-data && \
curl -L -O https://github.com/isucon/isucon9-qualify/releases/download/v2/bench1.zip && \
unzip -qq bench1.zip && \
rm -rf images && \
mv v3_bench1 images
.PHONY: setup-initial-data
setup-initial-data:
cd initial-data/result && \
curl -L -O https://github.com/isucon/isucon9-qualify/releases/download/v2/initial-data.zip && \
unzip -qq initial-data.zip && \
mv initial.sql ../../webapp/sql/90_initial.sql
.PHONY: clean-zip
clean-zip:
rm -f initial-data/bench1.zip
rm -f webapp/public/initial.zip
rm -f initial-data/result/initial-data.zip
.PHONY: all init vet errcheck staticcheck clean