forked from netdata/go.d.plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (47 loc) · 1.37 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
54
55
56
57
58
59
60
61
62
63
64
65
66
# SPDX-License-Identifier: GPL-3.0-or-later
DEV_MODULES := all
all: download vet test build
.PHONY: help
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: download
download: ## Download go modules
go mod download
.PHONY: build
build: clean ## Build package
hack/go-build.sh
.PHONY: clean
clean:
rm -rf bin vendor
.PHONY: check
check: fmt vet ## Run static code analysis
.PHONY: test
test: ## Run tests
go test ./... -race -cover -covermode=atomic
.PHONY: fmt
fmt:
hack/go-fmt.sh .
.PHONY: vet
vet:
go vet ./...
.PHONY: release
release: clean download ## Create all release artifacts
hack/go-build.sh all
hack/go-build.sh configs
hack/go-build.sh vendor
cd bin && sha256sum -b * >"sha256sums.txt"
.PHONY: dev
dev: dev-build dev-up ## Launch development build
dev-build:
docker-compose build
dev-up:
docker-compose up -d --remove-orphans
.PHONY: dev-exec
dev-exec: ## Get into development environment
docker-compose exec netdata bash
dev-log:
docker-compose logs -f netdata
dev-run: ## Run go.d.plugin inside development environment
go run github.com/netdata/go.d.plugin/cmd/godplugin -d -c conf.d
dev-mock: ## Run go.d.plugin inside development environment with mock config
go run github.com/netdata/go.d.plugin/cmd/godplugin -d -c ./mocks/conf.d -m $(DEV_MODULES)