-
Notifications
You must be signed in to change notification settings - Fork 42
/
Makefile
75 lines (52 loc) · 1.67 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
BINOUT = $(shell pwd)/build
R = localhost:5000
T = latest
G = $(shell git rev-parse --short HEAD)
protoc:
protoc --gogofaster_out=plugins=grpc:. -I=. rpc.proto
protoc-docker:
docker run --rm -v `pwd`:/src znly/protoc --gogofaster_out=plugins=grpc:. -I=. src/rpc.proto
integration_test:
go test -tags=integration -v -coverprofile=coverage_integration.txt -covermode=atomic -timeout=15m -parallel 1 ./...
unit_test:
go test -tags=unit -v -coverprofile=coverage_unit.txt -covermode=atomic -timeout=5m -race ./...
test: unit_test integration_test
fmt:
go fmt ./...
lint:
# https://github.com/golangci/golangci-lint#install
golangci-lint -c .golangci.yml run
check: fmt lint test
bench:
go test -bench=. -benchmem
upload:
cd cmd/graph && env GOOS=linux GOARCH=amd64 go build -o main
rsync -avz cmd/graph/main [email protected]:/root
docker:
docker build --build-arg=GIT_COMMIT=$(G) -t wavelet:$(T) .
ifneq ($(R),)
docker tag wavelet:$(T) $(R)/wavelet:$(T)
docker push $(R)/wavelet:$(T)
endif
docker_aws:
$(shell aws ecr get-login --no-include-email)
$(MAKE) docker 'R=010313437810.dkr.ecr.us-east-2.amazonaws.com/perlin' 'T=$(T)'
docker_hub:
$(MAKE) docker 'R=perlin' 'T=$(T)'
clean:
rm -rf $(BINOUT)
build-all: linux windows darwin linux-arm64
@echo "Done building all targets."
release: clean build-all
scripts/release.sh
linux:
scripts/build.sh -a linux-amd64
windows:
scripts/build.sh -a windows-amd64
darwin:
scripts/build.sh -a darwin-amd64
linux-arm64:
scripts/build.sh -a linux-arm64
license:
addlicense -l mit -c Perlin $(PWD)
.PHONY: protoc-docker test bench upload docker docker_aws docker_hub clean build-all release linux windows darwin linux-arm64 license