Skip to content

Commit

Permalink
Delete unused targets
Browse files Browse the repository at this point in the history
  • Loading branch information
dtan4 committed Mar 13, 2020
1 parent d247e5f commit 17fe56f
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 17fe56f

Please sign in to comment.