-
Notifications
You must be signed in to change notification settings - Fork 93
/
Makefile
49 lines (34 loc) · 986 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
DOCKER_IMAGE ?= kail
DOCKER_REPO ?= abozanich/$(DOCKER_IMAGE)
DOCKER_TAG ?= latest
BUILD_ENV = GOOS=linux GOARCH=amd64
GO = GO111MODULE=on go
ifdef TRAVIS
LDFLAGS += -X main.version=$(TRAVIS_BRANCH) -X main.commit=$(TRAVIS_COMMIT)
endif
build:
$(GO) build -o kail ./cmd/kail
build-linux:
$(BUILD_ENV) $(GO) build --ldflags '$(LDFLAGS)' -o kail-linux ./cmd/kail
test:
$(GO) test ./...
test-full: build image
$(GO) test -v -race ./...
image: build-linux
docker build -t $(DOCKER_IMAGE) .
image-minikube: build-linux
eval $$(minikube docker-env) && docker build -t $(DOCKER_IMAGE) .
image-push: image
docker tag $(DOCKER_IMAGE) $(DOCKER_REPO):$(DOCKER_TAG)
docker push $(DOCKER_REPO):$(DOCKER_TAG)
install-deps:
$(GO) mod download
release:
GITHUB_TOKEN=$$GITHUB_REPO_TOKEN goreleaser -f .goreleaser.yml
clean:
rm kail kail-linux dist 2>/dev/null || true
.PHONY: build build-linux \
test test-full \
image image-minikube image-push \
install-deps \
clean