-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile.toml
96 lines (86 loc) · 2.24 KB
/
Makefile.toml
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
extend = [
{ path = "make/common.toml" },
{ path = "make/minio.toml" },
{ path = "make/jaeger.toml" },
{ path = "make/prometheus.toml" },
{ path = "make/grafana.toml" },
]
[env]
RUST_BACKTRACE = 1
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
[config]
skip_core_tasks = true
[tasks.clean-all]
category = "Misc"
description = "Clean all downloaded binaries by deleting .run folder."
dependencies = ["prepare"]
script = '''
#!@duckscript
rm -rf "${PREFIX}"
'''
[tasks.clean-data]
category = "Misc"
description = "Clean data by deleting files in .run/data and ./run/log folder."
dependencies = ["prepare"]
script = '''
#!/bin/bash
set -e
rm -rf "${PREFIX_DATA}"
rm -rf "${PREFIX_LOG}"
'''
[tasks.d]
alias = "dev"
[tasks.dev]
category = "Develop"
description = "Start development envirorment."
dependencies = ["pre-dev", "setup-minio"]
script = '''
#!@duckscript
echo success
'''
[tasks.pre-dev]
category = "Develop"
description = "Downloads necessary tools and build required components."
dependencies = [
"clean-data",
"download-minio",
"download-mcli",
"download-jaeger",
"download-prometheus",
"download-grafana",
]
script = '''
#!/bin/bash
# run minio
tmux new -d -s runkv-minio ${PREFIX_BIN}/minio server --address 0.0.0.0:9000 --console-address 0.0.0.0:9090 ${PREFIX_DATA}
# run jaeger
tmux new -d -s runkv-jaeger ${PREFIX_BIN}/jaeger
# run prometheus
tmux new -d -s runkv-prometheus ${PREFIX_BIN}/prometheus/prometheus --config.file=etc/prometheus.yml --web.listen-address=0.0.0.0:9091 --storage.tsdb.path=${PREFIX_DATA}/prometheus-data
# run grafana
tmux new -d -s runkv-grafana ${PREFIX_BIN}/grafana/bin/grafana-server -homepath .run/bin/grafana -config etc/grafana.ini
sleep 2
'''
[tasks.setup-minio]
category = "Misc"
description = "Clean minio data with mcli."
dependencies = ["prepare"]
script = '''
#!/bin/bash
set -e
${PREFIX_BIN}/mcli alias set local http://127.0.0.1:9000 minioadmin minioadmin
${PREFIX_BIN}/mcli mb --quiet local/test
'''
[tasks.k]
alias = "kill"
[tasks.kill]
category = "Develop"
description = "Kill development environment."
script = '''
#!/bin/bash
tmux send-keys -t runkv-minio C-c
tmux send-keys -t runkv-jaeger C-c
tmux send-keys -t runkv-prometheus C-c
tmux send-keys -t runkv-grafana C-c
sleep 2
'''