-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
103 lines (73 loc) · 1.62 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
.PHONY: hello
hello:
@echo "Hello Everyone."
.PHONY: help
help:
@echo "Usage: make [target]"
@echo " hello: Print \"Hello Everyone!\"."
.PHONY: env
env:
set PYTHONPATH=${ROOT}
# DEVELOPMENT
define anod_env
conda create -p anod_env python==3.9 -y
endef
## # MONITORING # ##
.PHONY: up
up:
docker compose -f docker-compose.yaml up -d --build
.PHONY: down
down:
docker compose down
# logs_name ?= grafana
.PHONY: logs
logs:
docker compose logs otel-collector loki grafana prometheus alertmanager
# ifeq (${logs_name},true)
# echo "Getting logs... Please wait..."
# git commit -m "${message}"
# git push origin ${branch}
# else ifeq (${status}, false)
# echo "Withdrawing commit message..."
# git reset
## # TESTING # ##
.PHONY: test
test:
python tests/integration/main.py
.PHONY: qs
qs:
python tests/integration/quick_start.py
.PHONY: install
install:
@$(PIP) install -r requirements.txt
message ?= "fix: test"
status ?= true
branch ?= main
# args = $(foreach a,$($(subst -,_,$1)_args),$(if $(value $a),$a="$($a)"))
# rule1_args = message
# rule2_args = status
# rule3_args = branch
.PHONY: git_add
git_add:
git add . && git status
.PHONY: git_commit
git_commit:
ifeq (${status},true)
echo "Commit message:"
git commit -m "${message}"
git push origin ${branch}
else ifeq (${status}, false)
echo "Withdrawing commit message..."
git reset
else
echo "Error: Invalid status value. Only 'true' or 'false' are allowed."
exit 1
endif
.PHONY: custom_task
custom_task:
@echo "Custom message: ${message}"
@echo "Branch: ${branch}"
@echo "Status: ${status}"
.PHONY: clean
clean:
python -rf __pycache__