-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
71 lines (55 loc) · 1.7 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
GO ?= go
GOFMT ?= gofmt "-s"
PACKAGES ?= $(shell $(GO) list ./...)
GOFILES := $(shell find . -name "*.go" -type f -not -path './vendor/*')
DOCKER_COMPOSE_FILES = -f docker-compose.yaml -f docker-compose.janus.yaml -f docker-compose.mongodb.yaml -f docker-compose.rabbitmq.yaml -f docker-compose.rating.yaml -f docker-compose.redis.yaml -f docker-compose.tester.yaml
.PHONY: all
all: fmt lint vet test
.PHONY: build
build:
$(GO) build -o bin/rating-agent-janus .
.PHONY: test
test:
$(GO) test -cover -coverprofile=coverage.txt $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
.PHONY: test-short
test-short:
$(GO) test -cover -coverprofile=coverage.txt --short $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
.PHONY: fmt
fmt:
$(GOFMT) -w $(GOFILES)
.PHONY: lint
lint:
for pkg in ${PACKAGES}; do \
golint -set_exit_status $$pkg || GOLINT_FAILED=1; \
done; \
[ -z "$$GOLINT_FAILED" ]
.PHONY: vet
vet:
$(GO) vet $(PACKAGES)
.PHONY: clean
clean:
$(GO) clean -modcache -x -i ./...
find . -name coverage.txt -delete
rm bin/*
.PHONY: docker-build
docker-build:
docker build . -t canyan/rating-agent-janus:master
.PHONY: docker-build-acceptance
docker-build-acceptance:
docker build . -t canyan/rating-agent-janus:master -f Dockerfile.acceptance
.PHONY: docker-pull
docker-pull:
docker-compose $(DOCKER_COMPOSE_FILES) pull
.PHONY: docker-start
docker-start:
docker-compose $(DOCKER_COMPOSE_FILES) up -d
.PHONY: docker-test
docker-test:
docker exec rating-agent-janus_tester_1 pytest /tests/ -vv
.PHONY: docker-logs
docker-logs:
docker-compose $(DOCKER_COMPOSE_FILES) ps -a
docker-compose $(DOCKER_COMPOSE_FILES) logs
.PHONY: docker-stop
docker-stop:
docker-compose $(DOCKER_COMPOSE_FILES) down