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
# 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 -e VERSION=x.y.z release # tarball → ./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
# Exports a versioned tarball + checksum to ./dist/ (VERSION required,
# e.g. `docker compose run --build --rm -e VERSION=0.3.0 release`).
# The tarball layout is the install.sh contract:
# rootle-<VERSION>-<TARGET>.tar.gz containing <dir>/rootle
release:
build:
context: .
dockerfile: Dockerfile
target: builder
command:
- sh
- -c
- |
set -e
VERSION="$${VERSION:?set VERSION to the release version, e.g. -e VERSION=0.3.0}"
TARGET="x86_64-unknown-linux-musl"
PKG="rootle-$$VERSION-$$TARGET"
cargo build --release --locked \
&& strip target/release/rootle \
&& staging="$$(mktemp -d)" \
&& mkdir -p "$$staging/$$PKG" \
&& install -m755 target/release/rootle "$$staging/$$PKG/rootle" \
&& tar -czf "/dist/$$PKG.tar.gz" -C "$$staging" "$$PKG" \
&& cd /dist \
&& sha256sum "$$PKG.tar.gz" > "$$PKG.tar.gz.sha256" \
&& echo "released: /dist/$$PKG.tar.gz"
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.