Configuration File

Commands

Several sections of deckrun.toml take a command: deploy hooks, processes, cron jobs and exec health checks. Every one of them accepts the command in two forms: a string or an array.

Deckrun does not run commands through a shell. It starts the program directly, with the arguments you give it. So shell syntax such as cd, &&, ||, ;, pipes (|), redirections (>) or variables ($VAR) has no special meaning. When you need it, use the array form to call a shell explicitly.

String form

[deploy.pre]
  command = 'npx prisma migrate deploy'

Deckrun splits the string on whitespace (spaces, tabs and newlines) and uses the pieces as the program and its arguments. The example above runs npx with the arguments prisma, migrate and deploy.

  • Extra spaces before, after or between the arguments are ignored.
  • Quotes do not group words. command = 'echo "hello world"' passes "hello and world" as two separate arguments, quotes included.
  • Shell syntax is not interpreted. command = 'cd /app && npm start' tries to run a program called cd, which fails.

The string form is the simplest choice for a single program with plain arguments, which covers most commands.

Array form

[deploy.pre]
  command = ['npx', 'prisma', 'migrate', 'deploy']

Each element of the array is passed to the program exactly as written: the first element is the program, and the rest are its arguments. Nothing is split, trimmed or interpreted.

Use the array form when an argument contains spaces, or when you need shell features. To chain commands, call a shell with -c and pass the whole script as a single argument:

[deploy.pre]
  command = ['sh', '-c', 'npx prisma migrate deploy && npm run db:seed']

A shell must exist in your image

sh -c only works if your image includes a shell. Most base images do, but minimal ones such as distroless or scratch don't.

The array must contain at least the program, and the program can't be empty. Later elements may be empty strings.

Requires deck v1.2.0 or later

The array form needs deck v1.2.0 or later. Older versions of deck fail to read a deckrun.toml that uses it. Run deck version to check yours.

Wrapping commands in a script

Instead of writing a long shell one-liner in deckrun.toml, you can put the steps in a script, or in an npm run or make target, and run that. Both forms work:

[deploy.pre]
  command = 'npm run release:migrate'
Previous
Cron Jobs