Recovering the scripts / ad-hoc command interface #301
Closed
opened 2022-03-11 10:25:20 +00:00 by decentral1se
·
7 comments
Labels
Clear labels
abra
awaiting-feedback
backups
bug
build
ci/cd
community organising
contributing
coopcloud.tech
design
documentation
duplicate
enhancement
fedi
fedi-infra
finance
funding
good first issue
help wanted
installer
legal
performance
proposal
question
security
test
wontfix
Everything to do with abra
Ping/pong on comms
Something is not working
Go build related issues
Getting the robots into the mix
Opening this thing up
Contributors stuff
Our main website
Design thinking required
Let's write things together
This issue or pull request already exists
New feature
Democratic decision making
Money things
Anything related to grant funding
Easy start with development
Need some help
Installation related issues
Performance related
Large change which requires feedback & decisin making
More information is needed
Securing our shit
Unit or integration test suite
This won't be fixed
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting
trav (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/organising#301
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Recovering the abra.sh scripts interfaceto Recovering the scripts / ad-hoc command interfaceOK, I've got 3 functions implemented in https://git.coopcloud.tech/coop-cloud/hometown/src/branch/main/abra.sh that I think cover what we need to support. A regular function that should be run in the context of a container with 0 args, one with args & a function that should be run on the local work station.
I'm trying to come up an API for this which builds on our discussions / previous attempts:
Where
--envspecifies the environment to run the bash function within (e.g.streamingis a service. if not passed, defaults toapp?). For functions that should only be run with--env local, we can thread aCMD_ENV=$env(or whatever) into the invocation so that the script can error out if is run in the wrong environment.For implementation: I think I can just copy the
abra.shover to/tmpat run-time and run the script with args. Otherwise it is on the local work station which is easy.This will require some docs writing also.
I've tested the
-- <unlimited free args passed to functionin the following:And it seems to strip
--correctly and thread the rest. Should work!@3wordchant @knoflook whatcha reckon?
great! I like it!
I first found the term
envfor this a bit misleading. If I understand it correctly, it chooses the service of an stack (app). I first thought of some extra .env file to load...maybe one of this is more self-explanatory?
abra app cmd social.foo.com migrate --service streamingor
abra app cmd social.foo.com streaming migrateis maybe even closer to theabra app runsyntaxBut I would also be fine with
--env, was just a bit confused when reading it first.Oh yes, makes sense @yksflip! The
app runsyntax example looks solid. Maybe then for the scripts that should be run on the local work station, we can use--locallike we do forserver add.so we're going with:
abra app cmd <app> <service> <command> [--local]?if so, i think that's great!
Usage in the wild https://git.coopcloud.tech/coop-cloud/outline#deleting-a-user-e-g-to-fix-sso-weirdness
I am not sure if I should open an issue or just append to this closed one?
The --local flag behaves slightly different, than it should. As I understand it should be used like this
abra app command <domain> --local <command> -- <arguments>but in this case the<command>is interpreted as missing service. Instead I have to runabra app command <domain> --local -- <command> <arguments>.Either the Usage description or the command interpretation should be fixed.
EDIT:
The behaviour changes if I use the --local flag before the domain. If I run
abra app command --local <domain> <command> <arguments>(without--) it is also working, but still not as stated in the USAGE.Nice @moritz, I've opened up coop-cloud/organising#352 to track 👍