-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
53 lines (49 loc) · 1.53 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
53
SHELL := /bin/bash
GOCMD=go
MOVESANDBOX=mv ~/vms/lxd-probelxd-probe ~/vms-local/lxd-probe
GOMOD=$(GOCMD) mod
GOMOCKS=$(GOCMD) generate ./...
GOBUILD=$(GOCMD) build
GOTEST=$(GOCMD) test
BINARY_NAME=lxd-probe
GOCOPY=cp lxd-probe ~/vagrant_file/.
all:test lint build
fmt:
$(GOCMD) fmt ./...
lint:
$(GOCMD) get -d github.com/golang/mock/[email protected]
$(GOCMD) install -v github.com/golang/mock/mockgen
export PATH=$HOME/go/bin:$PATH
$(GOMOCKS)
./scripts/lint.sh
tidy:
$(GOMOD) tidy -v
test:
$(GOCMD) get -d github.com/golang/mock/[email protected]
$(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/lxd-probe;
build_local:
export PATH=$GOPATH/bin:$PATH;
export PATH=$PATH:/home/vagrant/go/bin
export PATH=$PATH:/home/root/go/bin
$(GOBUILD) ./cmd/lxd-probe;
build_remote:
GOOS=linux GOARCH=amd64 $(GOBUILD) -v ./cmd/lxd-probe
mv lxd-probe ~/boxes/basic_box/lxd-probe
build_docker_local:
docker build -t chenkeinan/lxd-probe:3 .
docker push chenkeinan/lxd-probe:3
dlv:
dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec ./lxd-probe
build_beb:
GOOS=linux GOARCH=amd64 $(GOBUILD) -v -gcflags='-N -l' cmd/lxd-probe/lxd-probe.go
scripts/deb.sh
.PHONY: all build install test