-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (38 loc) · 1.08 KB
/
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
51
52
DOCKER_IMAGE ?= kail
DOCKER_REPO ?= abozanich/$(DOCKER_IMAGE)
DOCKER_TAG ?= latest
IMG_LDFLAGS := -w -linkmode external -extldflags "-static"
build:
govendor build -i +program
ifeq ($(shell uname -s),Darwin)
build-linux:
GOOS=linux GOARCH=amd64 go build -o kail-linux ./cmd/kail
else
build-linux:
CC=$$(which musl-gcc) go build --ldflags '$(IMG_LDFLAGS)' -o kail-linux ./cmd/kail
endif
test:
govendor test +local
test-full: build
govendor test -v -race +local
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-libs:
govendor install +vendor,^program
install-deps:
go get github.com/kardianos/govendor
govendor sync
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-libs install-deps \
clean