-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile.old
57 lines (54 loc) · 1.85 KB
/
Makefile.old
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
53
54
55
56
57
SHELL := /bin/bash
GOCMD=go
MOVESANDBOX=mv ~/vms/kube-beacon/kube-beacon ~/vms-local/kube-beacon
GOMOD=$(GOCMD) mod
GOMOCKS=$(GOCMD) generate ./...
GOBUILD=$(GOCMD) build
GOTEST=$(GOCMD) test
BINARY_NAME=kube-beacon
GOCOPY=cp kube-beacon ~/vagrant_file/.
all:test lint build
fmt:
$(GOCMD) fmt ./...
lint:
./scripts/lint.sh
tidy:
$(GOMOD) tidy -v
test:
$(GOCMD) install github.com/golang/mock/mockgen@latest
$(GOCMD) install -v github.com/golang/mock/mockgen && export PATH=$GOPATH/bin:$PATH;
$(GOMOCKS)
$(GOTEST) ./... -coverprofile coverage.md fmt
$(GOCMD) tool cover -html=coverage.md -o coverage.html
$(GOCMD) tool cover -func coverage.md
build:
export PATH=$GOPATH/bin:$PATH;
export PATH=$PATH:/home/vagrant/go/bin
export PATH=$PATH:/home/root/go/bin
GOOS=linux GOARCH=amd64 $(GOBUILD) -v cmd/kube/kube-beacon.go;
install:build_travis
cp $(BINARY_NAME) $(GOPATH)/bin/$(BINARY_NAME)
test_travis:
$(GOCMD) install github.com/golang/mock/mockgen@latest
$(GOCMD) install -v github.com/golang/mock/mockgen && export PATH=$GOPATH/bin:$PATH;
$(GOMOCKS)
$(GOTEST) ./... -coverprofile coverage.md fmt
$(GOCMD) tool cover -html=coverage.md -o coverage.html
build_travis:
GOOS=linux GOARCH=amd64 $(GOBUILD) -v cmd/kube/kube-beacon.go;
build_remote:
GOOS=linux GOARCH=amd64 $(GOBUILD) -v -gcflags='-N -l' cmd/kube/kube-beacon.go
mv kube-beacon /Users/chenkeinan/boxes/basic_box/kube-beacon
build_docker:
export PATH=$GOPATH/bin:$PATH;
docker build -t chenkeinan/kube-beacon:latest .
docker push chenkeinan/kube-beacon:latest
build_docker_local:
docker build -t chenkeinan/kube-beacon:latest .
docker push chenkeinan/kube-beacon:latest
dlv:
dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec ./kube-beacon
build_beb:
GOOS=linux GOARCH=amd64 $(GOBUILD) -v -gcflags='-N -l' cmd/kube/kube-beacon.go
scripts/deb.sh
.PHONY: all build install test