We've raised a $22m Series A →Skip to docs content
Conductor

Reference

Run script reference

Reference for run script behavior

The run script launches your app, server, test watcher, or another long-running command from a workspace.

If your project cannot run cleanly from a workspace directory, use Spotlight testing to sync one workspace back to the repository root and test from there.

Example

python3 -m http.server --port "$CONDUCTOR_PORT"

How it works

The run script runs in your workspace directory, available as CONDUCTOR_WORKSPACE_PATH.

Use CONDUCTOR_PORT when a run script starts a local server. Conductor allocates ten ports to each workspace: CONDUCTOR_PORT through CONDUCTOR_PORT+9.

Run script mode

If your project cannot run multiple dev servers at once, use nonconcurrent mode. In this mode, starting a run script stops any other running run script first.

You can find this setting under Advanced in the Scripts section of Repository Settings.

Run multiple processes

If your run script starts multiple processes, keep them in the same process group so Conductor can clean them up together. Use concurrently or a similar tool instead of backgrounding commands with &.

Install concurrently:

npm install --save-dev concurrently

Then use it from your run script:

{
    "scripts": {
        "run": "concurrently \"npm run server\" \"npm run worker\""
    }
}

Avoid backgrounding processes:

{
    "scripts": {
        "run": "npm run server & npm run worker"
    }
}

When Conductor stops that script, the backgrounded server can keep running and hold ports, memory, or other resources.

For related setup and sharing options, see Running your projects.

On this page