forked from monitoror/monitoror
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
113 lines (87 loc) · 3.11 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#
# github.com/monitoror/monitoror
#
DEFAULT: build
MAKEFLAGS = --silent
# ============= TESTS =============
.PHONY: test
test: test-unit ## run tests
.PHONY: test-unit
test-unit: ## run unit tests, to change the output format use: GOTESTSUM_FORMAT=(dots|short|standard-quiet|short-verbose|standard-verbose) make test-unit
@./scripts/test/unit.sh
.PHONY: test-coverage
test-coverage: ## run test coverage
@./scripts/test/coverage.sh
.PHONY: test-coverage-html
test-coverage-html: ## run test coverage and generate cover.html
@./scripts/test/coverage-html.sh
# ============= LINT =============
.PHONY: lint
lint: ## run linter
@./scripts/test/lint.sh
# ============= MOCKS =============
.PHONY: mocks
mocks: ## generate mocks
@./scripts/mocks.sh
# ============= BUILDS =============
.PHONY: build
build: package-front package-defaultconfig ## build executable for current environment
@./scripts/build.sh
.PHONY: build-cross
build-cross: package-front package-defaultconfig ## build all executables
@./scripts/build.sh linux/amd64
@./scripts/build.sh linux/ARMv5
@./scripts/build.sh windows
@./scripts/build.sh macos
.PHONY: build-linux-amd64
build-linux-amd64: package-front package-defaultconfig ## build executable for Linux
@./scripts/build.sh linux/amd64
.PHONY: build-linux-ARMv5
build-linux-ARMv5: package-front package-defaultconfig ## build executable for Raspberry Pi (ARM V5)
@./scripts/build.sh linux/ARMv5
.PHONY: build-windows
build-windows: package-front package-defaultconfig ## build executable for Windows
@./scripts/build.sh windows
.PHONY: build-macos
build-macos: package-front package-defaultconfig ## build executable for MacOs
@./scripts/build.sh macos
.PHONY: build-faker-linux-amd64
build-faker-linux-amd64: package-front package-defaultconfig ## build faker executable linux amd64 (only for demo)
@MB_GO_TAGS="faker" ./scripts/build.sh linux/amd64
# ============= PACKAGE =============
.PHONY: package-front
package-front: ## package front directory ui/dist into go source
@./scripts/package/front.sh
.PHONY: package-defaultconfig
package-defaultconfig: ## package .env.example and config.example.json go source
@./scripts/package/default-config.sh
.PHONY: package-docker
package-docker: ## package linux amd64 into docker image
@./scripts/package/docker.sh
# ============= RUN =============
.PHONY: run
run: ## run monitoror
@./scripts/run.sh
.PHONY: run-faker
run-faker: ## run monitoror in faker mode
@MB_GO_TAGS="faker" ./scripts/run.sh
# ============= VERSION =============
.PHONY: version
version: ## bump version of monitoror
@./scripts/bump-version.sh
# ============= TOOLING =============
.PHONY: clean
clean: ## remove build artifacts
rm -rf ./binaries/*
.PHONY: install
install: ## installing monitoror dependencies
@./scripts/install.sh
.PHONY: install-tools
install-tools: ## install development tools
@./scripts/install-tools.sh
.PHONY: proxy
proxy: ## starting UI proxy for tests
@./scripts/proxy.sh
.PHONY: help
help: ## print this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)