-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (31 loc) · 720 Bytes
/
Makefile
File metadata and controls
41 lines (31 loc) · 720 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
default: czds
RELEASE_DEPS = fmt lint
include release.mk
DOCKER_REPO := "lanrat/czds"
BUILD_FLAGS := -trimpath -ldflags "-s -w -X main.version=${VERSION}"
SOURCES := $(shell find . -type f -name "*.go") go.mod go.sum
czds: $(SOURCES)
CGO_ENABLED=0 go build $(BUILD_FLAGS) -o $@ cmd/*.go
.PHONY: docker
docker: Dockerfile Makefile $(SOURCES)
docker build --build-arg VERSION=${VERSION} -t $(DOCKER_REPO) .
.PHONY: update-deps
update-deps: deps
go get -u ./...
go mod tidy
.PHONY: deps
deps: go.mod
go mod download
go mod tidy
.PHONY: fmt
fmt:
go fmt ./...
.PHONY: lint
lint:
golangci-lint run
.PHONY: clean
clean:
rm -rf czds dist/
.PHONY: goreleaser
goreleaser:
goreleaser release --snapshot --clean