-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
74 lines (57 loc) · 1.97 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
.PHONY: docker-all
docker-all: docker-env-up docker-test docker-env-down
.PHONY: docker-env-up
docker-env-up:
docker-compose -f contrib/docker-compose-for-tests.yml up -d
.PHONY: docker-env-down
docker-env-down:
docker-compose -f contrib/docker-compose-for-tests.yml down
.PHONY: docker-test
docker-test:
docker-compose -f contrib/docker-compose-for-tests.yml up -d
docker-compose -f contrib/docker-compose-for-tests.yml run --rm tests bash -c 'make test'
.PHONY: test
test:
contrib/tls/gen-test-certs.sh
TEST_REDIS_URI="redis://redis6:6379" \
TEST_REDIS5_URI="redis://redis5:6383" \
TEST_REDIS6_URI="redis://redis6:6379" \
TEST_REDIS_2_8_URI="redis://redis-2-8:6381" \
TEST_KEYDB01_URI="redis://keydb-01:6401" \
TEST_KEYDB02_URI="redis://keydb-02:6402" \
TEST_PWD_REDIS_URI="redis://:redis-password@pwd-redis5:6380" \
TEST_USER_PWD_REDIS_URI="redis://exporter:exporter-password@pwd-redis6:6390" \
TEST_REDIS_CLUSTER_MASTER_URI="redis://redis-cluster:7000" \
TEST_REDIS_CLUSTER_SLAVE_URI="redis://redis-cluster:7005" \
TEST_TILE38_URI="redis://tile38:9851" \
TEST_REDIS_SENTINEL_URI="redis://redis-sentinel:26379" \
go test -v -covermode=atomic -cover -race -coverprofile=coverage.txt -p 1 ./...
.PHONY: lint
lint:
#
# this will run the default linters on non-test files
# and then all but the "errcheck" linters on the tests
golangci-lint run --tests=false --exclude-use-default
golangci-lint run -D=errcheck --exclude-use-default
.PHONY: checks
checks:
go vet ./...
echo "checking gofmt"
echo " ! gofmt -d *.go 2>&1 | read " | bash
echo "checking gofmt - DONE"
.PHONY: mixin
mixin:
cd contrib/redis-mixin && \
$(MAKE) all && \
cd ../../
.PHONY: upload-coverage
upload-coverage:
go install github.com/mattn/[email protected]
/go/bin/goveralls -coverprofile=coverage.txt -service=drone.io
.PHONY: build
build:
go build .
.PHONY: release
release:
go install github.com/goreleaser/goreleaser/v2@latest
goreleaser release --clean -f .github/goreleaser.yml