-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (26 loc) · 692 Bytes
/
Makefile
File metadata and controls
34 lines (26 loc) · 692 Bytes
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
GO := go
NAME := dcache
REDIS_DOCKER_NAME=$(NAME)-redis
REDIS_PORT=6379
CGO_ENABLED = 0
GO111MODULE = on
docker-redis:
docker run -d=true --name $(REDIS_DOCKER_NAME) -p $(REDIS_PORT):6379 redis
stop-docker-redis:
docker stop $(REDIS_DOCKER_NAME)
docker rm $(REDIS_DOCKER_NAME)
test-start-all:
make docker-redis
test-stop-all:
make stop-docker-redis
test-cmd:
CGO_ENABLED=$(CGO_ENABLED) $(GO) test -p 1 . -test.v
test: test-start-all
GO111MODULE=$(GO111MODULE) make test-cmd && make test-stop-all || (make test-stop-all; exit 2)
.PHONY: lint lint-fix
lint:
@echo "--> Running linter"
@golangci-lint run
lint-fix:
@echo "--> Running linter auto fix"
@golangci-lint run --fix