-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (36 loc) · 1.1 KB
/
Makefile
File metadata and controls
51 lines (36 loc) · 1.1 KB
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
DOCKER_IMAGE ?= kail
DOCKER_REPO ?= reg-xs.qiniu.io/atlab/$(DOCKER_IMAGE)
DOCKER_TAG ?= $(shell date -u '+%Y%m%d')-$(shell git rev-parse --short HEAD)
BUILD_ENV = GOOS=linux GOARCH=amd64
ifdef TRAVIS
LDFLAGS += -X main.version=$(TRAVIS_BRANCH) -X main.commit=$(TRAVIS_COMMIT)
endif
build:
govendor build -i +program
build-linux:
$(BUILD_ENV) go build --ldflags '$(LDFLAGS)' -o kail-linux ./cmd/kail
test:
govendor test +local
test-full: build image
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 -u 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