Skip to content

Stack Groups

Griffen Fargo edited this page Apr 21, 2026 · 1 revision

Stack Groups

Run one strut command across many stacks. Since v0.15.0.

A group is a named list of stacks declared in groups.conf at the project root. strut group <name> <command> iterates the group and invokes strut <stack> <command> for each member, collecting pass/fail counts.

groups.conf

INI-style. Group names in brackets; one stack per line underneath. Comments start with #. A stack may appear in multiple groups.

# groups.conf — stack groups for `strut group <name> <command>`

[vps-1]
knowledge-graph
api-service

[postgres-stacks]
knowledge-graph
twenty

[critical]
api-service

strut group add / strut group remove edit this file in place. Hand-editing is also fine — the parser is pure awk.

Commands

strut group list                                          # List all groups + member counts
strut group show <name>                                   # List members (✓ present / ✗ missing)
strut group add <name> <stack>                            # Append a stack
strut group remove <name> <stack>                         # Remove a stack

strut group <name> <command> [--env <env>] [--stop-on-error] [--json] [options]
strut group <name> logs [--follow] [--since <dur>] [--grep <pattern>] [--service <svc>]

Flags:

Flag Effect
--stop-on-error Halt on the first failing stack (default: continue)
--json Emit a summary as JSON instead of a text summary

Missing stacks (in groups.conf but no stacks/<name>/) are warned and skipped — they don't count as a failure.

Exit code: 0 if every stack succeeded, 1 if any failed.

Example Workflows

Deploy every stack on a host

strut group vps-1 deploy --env prod
strut group vps-1 release --env prod

Backup all postgres stacks at once

strut group postgres-stacks backup postgres --env prod

Cross-stack health check

strut group critical health --env prod --json

Stop-on-error for CI

strut group vps-1 deploy --env prod --stop-on-error

Aggregated logs

group <name> logs (since v0.15.0) multiplexes logs from every stack in the group with a colored [stack] prefix on TTY (plain [stack] when piped). One background process per member.

strut group vps-1 logs --follow
strut group vps-1 logs --follow --grep 'ERROR|WARN'
strut group vps-1 logs --follow --service api --since 10m

Ctrl-C propagates to every child; the entrypoint's unified EXIT trap cleans up any stragglers.

Design Notes

  • Groups iterate sequentially — one stack completes before the next starts. Trades throughput for predictable state: one stack's failure won't corrupt another's environment.
  • Each member runs in its own strut subprocess ($0 <stack> <cmd>), re-using the same resolved Strut_Home and picking up any env-file changes cleanly.
  • Groups carry no ordering or dependency semantics — if you need an ordering rule, use --stop-on-error and declare the stacks in that order in groups.conf.

Related

Clone this wiki locally