1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00
mxpv-podsync/Makefile

50 lines
736 B
Makefile
Raw Normal View History

2019-05-09 10:36:35 -07:00
BINPATH := $(abspath ./bin)
GOLANGCI := $(BINPATH)/golangci-lint
2019-02-24 14:19:55 -08:00
2019-11-13 19:12:33 -08:00
.PHONY: all
all: build lint test
#
# Build Podsync CLI binary
#
.PHONY: build
build:
go build -o podsync ./cmd/podsync
#
# Build Docker image
#
.PHONY: docker
docker:
2019-11-23 13:25:23 -08:00
GOOS=linux GOARCH=amd64 go build -o podsync ./cmd/podsync
docker build -t mxpv/podsync:unstable .
docker push mxpv/podsync:unstable
2019-11-13 19:12:33 -08:00
#
# Pull GolangCI-Lint dependency
#
2019-02-24 14:19:55 -08:00
$(GOLANGCI):
2020-01-26 17:17:51 -08:00
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(BINPATH) v1.23.1
2019-05-09 10:36:35 -07:00
$(GOLANGCI) --version
2019-02-24 14:19:55 -08:00
2019-11-13 19:12:33 -08:00
#
# Run linter
#
2019-02-24 14:19:55 -08:00
.PHONY: lint
lint: $(GOLANGCI)
2019-05-09 10:36:35 -07:00
$(GOLANGCI) run
2019-02-24 14:19:55 -08:00
2019-11-13 19:12:33 -08:00
#
# Run unit tests
#
2019-02-24 14:19:55 -08:00
.PHONY: test
test:
2019-11-23 13:25:23 -08:00
go test -v ./...
2020-01-26 17:20:21 -08:00
#
# Clean
#
.PHONY: clean
clean:
- rm -rf $(BINPATH)