-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
205 lines (167 loc) · 6.44 KB
/
Taskfile.yaml
File metadata and controls
205 lines (167 loc) · 6.44 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# Taskfile.yaml
# tummycrypt/tcfs build system
# https://taskfile.dev
version: '3'
vars:
VERSION:
sh: git describe --tags --always --dirty 2>/dev/null || echo "0.1.0-dev"
COMMIT:
sh: git rev-parse --short HEAD 2>/dev/null || echo "unknown"
tasks:
default:
desc: Show available tasks
cmds:
- task --list
# ── Rust workspace ──────────────────────────────────────────────────────────
build:
desc: Build all Rust crates (debug)
cmds:
- cargo build --workspace
build:release:
desc: Build all Rust crates (release)
cmds:
- cargo build --workspace --release
test:
desc: Run all tests
cmds:
- cargo test --workspace
lint:
desc: Run clippy (deny warnings) + rustfmt check
cmds:
- cargo clippy --workspace -- -D warnings
- cargo fmt --all -- --check
fmt:
desc: Auto-format all Rust code
cmds:
- cargo fmt --all
clean:
desc: Clean build artifacts
cmds:
- cargo clean
bench:
desc: Run all divan benchmarks
cmds:
- ~/.cargo/bin/cargo bench -p tcfs-chunks --bench chunks
- ~/.cargo/bin/cargo bench -p tcfs-crypto --bench crypto
deny:
desc: Check licenses and advisories (cargo-deny)
cmds:
- cargo deny check
audit:
desc: Check for security advisories (cargo-audit)
cmds:
- cargo audit
# ── Local dev stack ─────────────────────────────────────────────────────────
dev:
desc: Start local dev stack (SeaweedFS + NATS + Prometheus + Grafana)
deps:
- generate-certs
cmds:
- docker-compose up -d
- cmd: 'echo ""'
- cmd: 'echo "Local dev stack started:"'
- cmd: 'echo " SeaweedFS master-1: http://localhost:9333"'
- cmd: 'echo " SeaweedFS master-2: http://localhost:9334"'
- cmd: 'echo " SeaweedFS master-3: http://localhost:9335"'
- cmd: 'echo " SeaweedFS volume: http://localhost:8080"'
- cmd: 'echo " SeaweedFS filer: http://localhost:8888"'
- cmd: 'echo " SeaweedFS S3: http://localhost:8333"'
- cmd: 'echo " NATS: nats://localhost:4222"'
- cmd: 'echo " NATS monitoring: http://localhost:8222"'
- cmd: 'echo " Prometheus: http://localhost:9090"'
- cmd: 'echo " Grafana: http://localhost:3000 (admin/admin)"'
- cmd: 'echo ""'
- cmd: 'echo "Logs: docker-compose logs -f"'
dev:stop:
desc: Stop local dev stack
cmds:
- docker-compose down
dev:restart:
desc: Restart local dev stack
cmds:
- task: dev:stop
- task: dev
dev:logs:
desc: Tail local dev stack logs
cmds:
- docker-compose logs -f
dev:status:
desc: Show local dev stack status
cmds:
- docker-compose ps
# ── Certificates ─────────────────────────────────────────────────────────────
generate-certs:
desc: Generate SeaweedFS TLS certificates
cmds:
- bash scripts/generate-certs.sh
# ── SOPS / Credentials ───────────────────────────────────────────────────────
sops:init:
desc: Bootstrap SOPS+age keys (run once on setup)
cmds:
- bash scripts/sops-init.sh
sops:migrate:
desc: Migrate plaintext credentials from Ansible inventory to SOPS
cmds:
- bash scripts/migrate-credentials.sh
sops:encrypt:
desc: "Encrypt a file with SOPS: task sops:encrypt FILE=credentials/foo.yaml"
vars:
FILE: '{{.FILE}}'
cmds:
- sops --encrypt --in-place {{.FILE}}
sops:decrypt:
desc: "Decrypt a SOPS file to stdout: task sops:decrypt FILE=credentials/foo.yaml"
vars:
FILE: '{{.FILE}}'
cmds:
- sops --decrypt {{.FILE}}
# ── Infrastructure ───────────────────────────────────────────────────────────
infra:plan:
desc: "OpenTofu plan: task infra:plan ENV=civo"
vars:
ENV: '{{.ENV | default "local"}}'
cmds:
- cd infra/tofu/environments/{{.ENV}} && tofu plan
infra:apply:
desc: "OpenTofu apply: task infra:apply ENV=civo"
vars:
ENV: '{{.ENV | default "local"}}'
cmds:
- cd infra/tofu/environments/{{.ENV}} && tofu apply
infra:destroy:
desc: "OpenTofu destroy (DESTRUCTIVE): task infra:destroy ENV=local"
vars:
ENV: '{{.ENV | default "local"}}'
prompt: "This will DESTROY infrastructure in '{{.ENV}}'. Continue?"
cmds:
- cd infra/tofu/environments/{{.ENV}} && tofu destroy
# ── Cross-compilation ─────────────────────────────────────────────────────────
cross:build:
desc: Cross-compile all targets (requires cargo cross)
cmds:
- bash scripts/cross-compile.sh
# ── Convenience ──────────────────────────────────────────────────────────────
check:
desc: Run all checks (build + lint + test + deny)
cmds:
- task: build
- task: lint
- task: test
- task: deny
# ── Documentation ──────────────────────────────────────────────────────────
docs:links:
desc: Check for broken links in documentation
cmds:
- lychee --config .lychee.toml "docs/**/*.md" "README.md"
docs:pdf:
desc: Build PDF versions of technical design docs (LaTeX → PDF)
cmds:
- mkdir -p dist/docs
- cmd: 'cd docs/tex && tectonic architecture.tex -o ../../dist/docs'
- cmd: 'cd docs/tex && tectonic protocol.tex -o ../../dist/docs'
- cmd: 'cd docs/tex && tectonic security.tex -o ../../dist/docs'
- cmd: 'cd docs/tex && tectonic fileprovider.tex -o ../../dist/docs'
docs:serve:
desc: Serve docs site locally with Jekyll
cmds:
- cd docs && bundle exec jekyll serve