-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
56 lines (39 loc) · 1.54 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
.PHONY: all
all: build
FORCE: ;
.PHONY: build
build: build-auth build-feedback build-vote
build-auth:
cd auth; go build -o bin/auth main.go
build-feedback:
cd feedbacks; go build -o bin/feedbacks main.go
build-vote:
cd votes; go build -o bin/votes main.go
build-auth-linux:
cd auth; CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -tags "netgo" -installsuffix netgo -o bin/auth main.go
build-feedbacks-linux:
cd feedbacks; CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -tags "netgo" -installsuffix netgo -o bin/feedbacks main.go
build-votes-linux:
cd votes; CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -tags "netgo" -installsuffix netgo -o bin/votes main.go
build-linux: build-auth-linux build-feedbacks-linux build-votes-linux
build-auth-docker: build-auth-linux
cd auth; docker build -t auth -f Dockerfile .
build-feedbacks-docker: build-feedbacks-linux
cd feedbacks; docker build -t feedbacks -f Dockerfile .
build-votes-docker: build-votes-linux
cd votes; docker build -t votes -f Dockerfile .
generate-mocks:
@cd auth ; mockery --output user/mocks --dir user --all
@cd internal ; mockery --output telemetry/mocks --dir telemetry --all
clean:
@rm -rf auth/user/mocks/*
@rm -rf internal/telemetry/mocks/mocks/*
test: generate-mocks
go test ./...
cd auth ; go test ./...
cd feedbacks; go test ./...
cd votes; go test ./...
run-docker: build-auth-docker build-feedbacks-docker build-votes-docker
docker run -d -p 8081:8081 auth
docker run -d -p 8082:8082 feedbacks
docker run -d -p 8083:8083 votes