Pass --chaos status to abra.sh --local commands #571

Open
opened 2025-06-07 14:00:03 +00:00 by 3wordchant · 0 comments
Owner

For e.g. the commands in Mastodon's abra.sh for generating secrets, invocations of abra fail during a --chaos run, even with the flags seemingly in the right place:

➜ abra app cmd --chaos  --local mastodon.EXAMPLE.COM secrets && abra app cmd --chaos --local mastodon.EXAMPLE.COM secrets_activerecord 
Generating secrets for a new Mastodon deployment...

FATA mastodon (/home/USER/.abra/recipes/mastodon) has locally unstaged changes?
FATA exit status 1

An alternative could be to unconditionally pass --chaos in invocations of abra in abra.sh scripts, which might be less work¹, but would be slightly inconsistent with abra's "bail on any forbidden-chaos state" behaviour.

Setting e.g. an ABRA_IS_CHAOS environment variable when loading the local abra.sh file would allow shell functions to conditionally insert --chaos depending on whether it was specified on the abra app cmd --local command-line.

¹12 recipes seem to have abra.sh scripts which call abra:

rg -g '**/abra.sh' 'abra app' -l | wc -l
gotosocial/abra.sh
nextcloud/abra.sh
matrix-synapse/abra.sh
mastodon/abra.sh
outline/abra.sh
xwiki/abra.sh
authentik/abra.sh
funkwhale/abra.sh
zammad/abra.sh
peertube/abra.sh
vaultwarden/abra.sh
hometown/abra.sh
For e.g. the [commands in Mastodon's `abra.sh` for generating secrets](https://git.coopcloud.tech/coop-cloud/mastodon/src/branch/main/abra.sh#L74-L154), invocations of `abra` fail during a `--chaos` run, even with the flags seemingly in the right place: ``` ➜ abra app cmd --chaos --local mastodon.EXAMPLE.COM secrets && abra app cmd --chaos --local mastodon.EXAMPLE.COM secrets_activerecord Generating secrets for a new Mastodon deployment... FATA mastodon (/home/USER/.abra/recipes/mastodon) has locally unstaged changes? FATA exit status 1 ``` An alternative could be to unconditionally pass `--chaos` in invocations of `abra` in `abra.sh` scripts, which might be less work¹, but would be slightly inconsistent with `abra`'s "bail on any forbidden-chaos state" behaviour. Setting e.g. an `ABRA_IS_CHAOS` environment variable when loading the local `abra.sh` file would allow shell functions to conditionally insert `--chaos` depending on whether it was specified on the `abra app cmd --local` command-line. ¹12 recipes seem to have `abra.sh` scripts which call `abra`: ``` rg -g '**/abra.sh' 'abra app' -l | wc -l gotosocial/abra.sh nextcloud/abra.sh matrix-synapse/abra.sh mastodon/abra.sh outline/abra.sh xwiki/abra.sh authentik/abra.sh funkwhale/abra.sh zammad/abra.sh peertube/abra.sh vaultwarden/abra.sh hometown/abra.sh ```
3wordchant added the
enhancement
label 2025-06-07 14:00:03 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: toolshed/abra#571
No description provided.