by yeti-sh · 3y ago · 0 comments
compose = sh.docker.compose.bake('-f', 'deploy/dev.yml')
…
compose.down()
…
compose.up('--force-recreate', '-d')
I feel this is a major improvement on top of Makefiles + shell commands in them. Nice API _matters_; it is ergonomics and therefore productivity.You can specify `_out=rich.print` and it will work but AFAIK it won't scrape ASCII terminal formatting characters.
I had to fix these characters in my `sh` based scripts but do not consider that as a big deal.
Does not seem very ergonimic to me.
- command actually executed,
- snippet of stdout
- and snippet of stderr.
They can be handled using standard exception techniques.
compose.up()
contains the command's stdout.In addition stdout can be redirected to a file, or to another command, or to a callable, — which will be called for chunks of stdout while the command is in operation.