forked from mailhog/MailHog
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (38 loc) · 1.17 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
VERSION := 2.0.0
GOLANGCI_VERSION := 1.27.0
GOBINDATA_VERSION := 3
GOX_VERSION := 1.0.1
TEST_FLAGS :=
GO111MODULE := on
export GO111MODULE
.PHONY: all
all: deps assets queries build test lint
.PHONY: build
build: deps assets queries
go build .
cd cmd/mhsendmail && go build .
.PHONY: test
test: deps assets
[ -n "$$TEST_MONGODB_URI" ] || echo 'Warning, MongoDB storage testing disabled!' >&2
[ -n "$$TEST_POSTGRESQL_URI" ] || echo 'Warning, PostgreSQL storage testing disabled!' >&2
go test -race $(TEST_FLAGS) ./...
.PHONY: release
release: deps assets test lint
gox -ldflags "-X main.version=${VERSION}" -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}" .
.PHONY: lint
lint: deps
golangci-lint run
.PHONY: deps
deps:
go mod download
go get github.com/go-bindata/go-bindata/...@v${GOBINDATA_VERSION}
go get github.com/golangci/golangci-lint/...@v${GOLANGCI_VERSION}
go get github.com/mitchellh/gox/...@v${GOX_VERSION}
.PHONY: assets
assets: deps
rm -f generated/assets/assets.go
go-bindata -o generated/assets/assets.go -pkg assets assets/...
.PHONY: queries
queries: deps
rm -f generated/queries/queries.go
go-bindata -o generated/queries/queries.go -pkg queries queries/...