Run (experimental)
warning
Run tasks are still experimental. Be nice to them.
A tasks defined under the run:
directive is referred to as run task .
Run tasks lets you define local development environments consisting of one or multiple binaries and compose files.
## bob.yaml
dependencies: [ go_1_19 ]
build:
build:
input: |-
main1.go
cmd: |-
go build -o app
target: app
run:
app:
path: app
dependsOn:
- build
A run tasks can be started using bob run taskname
. In this case it's:
bob run app
This will launch a terminal ui similar to this:
TAB
switch between logs and statusESC
follow outputctrl-r
rebuild if necessary and restart.ctrl-s
switch between scrolling and copy text mode.ctrl+c
shutdown.
Types
By default, a run task assumes a binary to be executed. Though, it also accepts a compose file as input.
## bob.yaml
run:
run:
type: compose
This will search for a docker-compose.yaml in the same dir as your bob.yaml is located.
The path
keyword can be used to point to the correct location of the compose file
## bob.yaml
run:
run:
type: compose
path: dir/docker-compose.yaml
Combine Run- and Build-Tasks
Tasks can depend on other run tasks. This is useful if your binaries require run time dependencies like databases defined in compose files.
## bob.yaml
dependencies: [ go_1_19 ]
build:
build:
input: |-
main1.go
cmd: |-
go build -o app
target: app
run:
app:
path: app
dependsOn:
- build
- database
database:
type: compose
Bob takes care of building, starting and shutting down everything together. No more scripts needed to run a local development environment.