Repository navigation
Tasks and Rebuilds
[[task]] entries are setup steps, such as builds, package installs and migrations, that must finish before the apps start.
[[task]]
name = "install"
command = 'cmd /c npm ci'
cwd = 'web'
[[task]]
name = "build"
command = 'dotnet build src\App.sln -nodeReuse:false'
stops = ["api", "worker"]- One at a time, in config order, each to completion, before any app is launched.
- The running task has a tile. Once every task has succeeded, the task tile disappears and the apps start.
- Tasks default to
exit_with = "main", so build servers left running don't hold them open.
If a task exits with a non-zero code, everything after it waits. Its tile stays with the error output, and the apps show waiting for build (exited with code 1).
Fix the problem, then either press Enter in the task's console or run:
brady-ctl run buildWhen it succeeds, startup carries on.
Once the stack is up, brady-ctl run <task> reruns a task. The problem is that running apps usually lock the files a build writes (MSBuild reports MSB3027/MSB3021). List those apps in the task's stops:
[[task]]
name = "build"
command = 'dotnet build src\App.sln -nodeReuse:false'
stops = ["api", "worker"]Then:
brady-ctl run buildrun stops api and worker (dependents first), runs the build in its tile, starts them again, and waits until they're ready:
build: done (8.4s); restarted api, worker; ready (14.8s)
--stop app,app adds more apps for a single run. If the build fails, run exits with code 4, the task's tile shows the errors, and the stopped apps wait for the task to succeed. Fix it and run brady-ctl run build again.
-
For one launch:
--skip build(or a profile withskip = ["build"]) doesn't run the task at startup. It shows asskipped, nothing waits for it, andbrady-ctl run buildstill runs it later. This makes a fast "start without building" profile possible:[profiles] quick = { skip = ["build"] }
-
While another copy is running:
skip_if_running = ["web"]runsweb'srunning_if(orskip_if_ready) check first, and skips the task ifwebis already running elsewhere. For example, sonpm installdoesn't rewritenode_modulesunder another running dev server:[[task]] name = "install" command = 'cmd /c npm install' cwd = 'web' skip_if_running = ["web"] [[app]] name = "web" command = 'cmd /c npm start' cwd = 'web' running_if = { tcp = 3000 }
The named apps need such a check, but they don't need to be in the current selection.