forked from mxpv/podsync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (43 loc) · 735 Bytes
/
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
BINPATH := $(abspath ./bin)
GOLANGCI := $(BINPATH)/golangci-lint
.PHONY: all
all: build lint test
#
# Build Podsync CLI binary
#
.PHONY: build
build:
go build -o bin/podsync ./cmd/podsync
#
# Build Docker image
#
TAG ?= localhost/podsync
.PHONY: docker
docker:
GOOS=linux GOARCH=amd64 go build -o podsync ./cmd/podsync
docker build -t $(TAG) .
docker push $(TAG)
#
# Pull GolangCI-Lint dependency
#
$(GOLANGCI):
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(BINPATH) v1.23.1
$(GOLANGCI) --version
#
# Run linter
#
.PHONY: lint
lint: $(GOLANGCI)
$(GOLANGCI) run
#
# Run unit tests
#
.PHONY: test
test:
go test -v ./...
#
# Clean
#
.PHONY: clean
clean:
- rm -rf $(BINPATH)