forked from mittwald/brudi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (44 loc) · 1.57 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
BINARY_NAME = brudi
COMMIT_HASH = $(shell git rev-parse --verify HEAD)
CURDIR = $(shell pwd)
GOLANGCI_LINT_VER = v1.23
.PHONY: build
all: dep test lint build
dep:
go mod tidy
go mod download
build:
go build \
-ldflags " \
-s \
-w \
-X \
'github.com/mittwald/brudi/cmd.tag=$(COMMIT_HASH)' \
" \
-o $(BINARY_NAME) \
-a main.go
test:
go test -v ./...
lintpull:
docker pull golangci/golangci-lint:$(GOLANGCI_LINT_VER)
lint: lintpull
docker run --rm -v $(CURDIR):/app -w /app golangci/golangci-lint:$(GOLANGCI_LINT_VER) golangci-lint -c build/ci/.golangci.yml run -v
lintfix: lintpull
docker run --rm -v $(CURDIR):/app -w /app golangci/golangci-lint:$(GOLANGCI_LINT_VER) golangci-lint -c build/ci/.golangci.yml run -v --fix
goreleaser:
curl -sL https://git.io/goreleaser | bash -s -- --snapshot --skip-publish --rm-dist
upTestMongo: downTestMongo
trap 'cd $(CURDIR) && make downTestMongo' 0 1 2 3 6 9 15
docker-compose --file example/docker-compose/mongo.yml up -d
downTestMongo:
docker-compose --file example/docker-compose/mongo.yml down -v --remove-orphans
upTestMysql: downTestMysql
trap 'cd $(CURDIR) && make downTestMysql' 0 1 2 3 6 9 15
docker-compose --file example/docker-compose/mysql.yml up -d
downTestMysql:
docker-compose --file example/docker-compose/mysql.yml down -v --remove-orphans
upTestPostgres: downTestPostgres
trap 'cd $(CURDIR) && make downTestPostgres' 0 1 2 3 6 9 15
docker-compose --file example/docker-compose/postgresql.yml up -d
downTestPostgres:
docker-compose --file example/docker-compose/postgresql.yml down -v --remove-orphans