-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
88 lines (75 loc) · 3.02 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
dev := $(or $(dev), 'false')
ifneq (,$(wildcard .env))
include .env
export
endif
.PHONY: help
.DEFAULT_GOAL := help
help:
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: clean
clean: ## Clean project area
@mvn clean
.PHONY: prepare
prepare: ## Install prerequisites
@mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:tree -Dverbose=true
.PHONY: test
test: clean ## Run both unit and integration tests
@mvn test
@mvn verify
.PHONY: lint
lint: ## Run Apache Spotless linter
@mvn spotless:apply
.PHONY: create-local-api-server
create-local-api-server: ## Create ObjectStorage local directory for API Server
@mkdir -p $(HOME)/.objectstorage/config
@mkdir -p $(HOME)/.objectstorage/diagnostics/prometheus/internal
@mkdir -p $(HOME)/.objectstorage/diagnostics/prometheus/config
@mkdir -p $(HOME)/.objectstorage/diagnostics/grafana/internal
@mkdir -p $(HOME)/.objectstorage/diagnostics/grafana/config/dashboards
@mkdir -p $(HOME)/.objectstorage/diagnostics/grafana/config/datasources
@mkdir -p $(HOME)/.objectstorage/workspace
@mkdir -p $(HOME)/.objectstorage/internal/database
.PHONY: clone-client-config
clone-client-config: ## Clone configuration files to local directory
@cp -r ./samples/config/client/user.yaml $(HOME)/.objectstorage/config
.PHONY: clone-api-server-config
clone-api-server-config: ## Clone ObjectStorage API Server configuration files to local directory
@cp -r ./config/grafana/dashboards/dashboard.yml $(HOME)/.objectstorage/diagnostics/grafana/config/dashboards
@cp -r ./config/grafana/dashboards/diagnostics.tmpl $(HOME)/.objectstorage/diagnostics/grafana/config/dashboards
@cp -r ./config/grafana/datasources/datasource.tmpl $(HOME)/.objectstorage/diagnostics/grafana/config/datasources
@cp -r ./config/prometheus/prometheus.tmpl $(HOME)/.objectstorage/diagnostics/prometheus/config
@cp -r ./samples/config/api-server/api-server.yaml $(HOME)/.objectstorage/config
.PHONY: clone-cluster
clone-cluster: ## Clone Cluster JAR into a ObjectStorage local directory
ifeq (,$(wildcard $(HOME)/.objectstorage/bin/cluster))
@mkdir -p $(HOME)/.objectstorage/bin
endif
@cp -r ./bin/cluster $(HOME)/.objectstorage/bin/
.PHONY: clone-api-server
clone-api-server: ## Clone API Server JAR into a ObjectStorage local directory
ifeq (,$(wildcard $(HOME)/.objectstorage/bin/api-server))
@mkdir -p $(HOME)/.objectstorage/bin
endif
@cp -r ./bin/api-server $(HOME)/.objectstorage/bin/
.PHONY: build-api-server
build-api-server: clean create-local-api-server clone-api-server-config ## Build API Server application
ifneq (,$(wildcard ./bin/api-server))
@rm -r ./bin/api-server
endif
ifeq ($(dev), 'false')
@mvn -pl api-server -T10 install -U
else
@mvn -P dev -pl api-server -T10 install -U
endif
$(MAKE) clone-api-server
.PHONY: build-cli
build-cli: clean clone-client-config ## Build CLI application
ifneq (,$(wildcard ./bin/cli))
@rm -r ./bin/cli
endif
ifeq ($(dev), 'false')
@mvn -pl cli -T10 install -U
else
@mvn -P dev -pl cli -T10 install -U
endif