-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (35 loc) · 868 Bytes
/
Makefile
File metadata and controls
44 lines (35 loc) · 868 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
35
36
37
38
39
40
41
42
43
44
GO ?= go
PROJECT := go-service-example
PLATFORMS=darwin linux
GOARCH := amd64
vendor:
go mod tidy
go mod vendor
.PHONY: vendor
linter:
./bin/golangci-lint run ./...
.PHONY: linter
test: linter
env CGO_ENABLED=1 go test -race ./...
.PHONY: test
build: test vendor
go build -o build/${PROJECT} ./cmd/${PROJECT}
.PHONY: build
build_all:
$(foreach GOOS, $(PLATFORMS), \
$(shell \
export GOOS=$(GOOS); \
export GOARCH=$(GOARCH); \
go build -o build/${PROJECT}-${GOOS}-${GOARCH} ./app/cmd; ))
run: build
build/${PROJECT}
.PHONY: run
golangcilint.download:
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh
go mod download
.PHONY: golangcilint.download
config.copy:
cp configs/.env.dist ./.env
.PHONY: config.copy
setup: golangcilint.download config.copy vendor
.PHONY: setup