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
# rootle build/test/release services (PLAN.md §13).
# docker compose run --rm test # fmt + clippy + tests
# docker compose run --rm build # debug build (warm cache check)
# docker compose run --rm release # exports static binary to ./dist/
services:
test:
build:
context: .
dockerfile: Dockerfile
target: test
# The gate runs at image-build time (RUN steps); if the image
# exists, the gate passed. The command is just a confirmation.
command: 'echo "gate passed: fmt + clippy -D warnings + cargo test"'
build:
build:
context: .
dockerfile: Dockerfile
target: builder
command: cargo build --locked
release:
build:
context: .
dockerfile: Dockerfile
target: builder
command:
- sh
- -c
- |
cargo build --release --locked \
&& strip target/release/rootle \
&& install -m755 target/release/rootle /dist/rootle-linux-x86_64-musl \
&& cd /dist \
&& sha256sum rootle-linux-x86_64-musl > rootle-linux-x86_64-musl.sha256 \
&& echo "released: /dist/rootle-linux-x86_64-musl"
volumes:
- ./dist:/dist
e2e:
build:
context: .
dockerfile: Dockerfile
target: e2e
# PTY suite runs at container start (CMD in the Dockerfile); the
# `test`-stage gate + compile are reused from the image cache —
# `docker compose run --build --rm e2e` after source changes.