diff --git a/Makefile b/Makefile index 1044d70..d8db8ec 100644 --- a/Makefile +++ b/Makefile @@ -5,13 +5,6 @@ REVISION := $(shell git rev-parse --short HEAD) SRCS := $(shell find . -name '*.go' -type f) LDFLAGS := -ldflags="-s -w -X \"main.Version=$(VERSION)\" -X \"main.Revision=$(REVISION)\"" -DIST_DIRS := find * -type d -exec - -DOCKER_REPOSITORY := quay.io -DOCKER_IMAGE_NAME := $(DOCKER_REPOSITORY)/dtan4/k8stail -DOCKER_IMAGE_TAG ?= latest -DOCKER_IMAGE := $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) - .DEFAULT_GOAL := bin/$(NAME) export GO111MODULE=on @@ -23,45 +16,14 @@ bin/$(NAME): $(SRCS) ci-test: go test -coverpkg=./... -coverprofile=coverage.txt -v ./... -.PHONY: ci-docker-release -ci-docker-release: docker-build - @docker login -u="$(DOCKER_QUAY_USERNAME)" -p="$(DOCKER_QUAY_PASSWORD)" $(DOCKER_REPOSITORY) - docker push $(DOCKER_IMAGE) - .PHONY: clean clean: rm -rf bin/* -.PHONY: cross-build -cross-build: - for os in darwin linux windows; do \ - for arch in amd64 386; do \ - GOOS=$$os GOARCH=$$arch CGO_ENABLED=0 go build $(LDFLAGS) -o dist/$$os-$$arch/$(NAME); \ - done; \ - done - -.PHONY: dist -dist: - cd dist && \ - $(DIST_DIRS) cp ../LICENSE {} \; && \ - $(DIST_DIRS) cp ../README.md {} \; && \ - $(DIST_DIRS) tar -zcf $(NAME)-$(VERSION)-{}.tar.gz {} \; && \ - $(DIST_DIRS) zip -r $(NAME)-$(VERSION)-{}.zip {} \; && \ - cd .. - -.PHONY: docker-build -docker-build: - docker build -t $(DOCKER_IMAGE) . - .PHONY: install install: go install $(LDFLAGS) -.PHONY: release -release: - git tag $(VERSION) - git push origin $(VERSION) - .PHONY: test test: go test -cover -v