start
start a run now
⏱️ Start a run now.
Give a command after -- to run it once in the service's image, with the
service's variables and size: a task run, such as a database migration or a
one-off script. The command runs without a shell: quoting groups words into
one argument, but pipes, && and $VARIABLES are passed as plain text. To use
them, run a shell yourself: -- sh -c '<command>'.
Without a command, a scheduled job runs its own command, alongside the schedule: the next scheduled run is not moved or replaced, and a paused job can still be run. Any other service needs a command.
The command returns as soon as the run is accepted. Add --wait to follow it until it succeeds or fails: progress goes to stderr and the final run to stdout, in any --output format. With --wait the exit code says how it ended:
0 succeeded 1 failed 8 still running when --wait-timeout ran out
Read what the run wrote with
csph deployment runs logs <run-id> --deployment <deployment-id>, and stop a
run that is still going with
csph deployment runs cancel <deployment-id> <run-id>.
Usage
csph deployments runs start <deployment-id> [-- <command>...] [flags]
Aliases
deployments runs start, deployments runs now, deployments runs trigger, deployments run start, deployments run now, deployments run trigger, deployment runs start, deployment runs now, deployment runs trigger, deployment run start, deployment run now, deployment run trigger, deploys runs start, deploys runs now, deploys runs trigger, deploys run start, deploys run now, deploys run trigger
Options
Command Specific
Formatting
For more information about formatting options, see Formatting.
Available Fields
command, deployment_id, duration_ms, exit_code, finished_at, id, job_name, line_count, message, object, started_at, status, triggered_by
Inherited
Examples
# run a database migration and wait for it to finish
> csph deployment runs start <deployment-id> --wait -- npm run migrate
# run a shell command
> csph deployment runs start <deployment-id> --wait -- sh -c 'echo "$APP_ENV"'
# run a scheduled job now
> csph deployment runs start <deployment-id>
# in CI: wait up to 15 minutes, then print the final run as JSON
> csph deployment runs start <deployment-id> --wait --wait-timeout 15m --output json -- ./bin/seed
# pick the deployment interactively (a scheduled job)
> csph deployment runs start
See also
- csph deployments runs — start and manage runs
- csph deployments runs list — list a scheduled job's runs
- csph deployments runs logs — read what a run wrote
- csph deployments runs cancel — cancel a run that is still going