Skip to content

Type a word or two, like firewall or rollback.

Open Coresmith
Browse the docs
Apps Checked against Coresmith 0.8.22.

Use your own deploy script

Open as Markdown

The Deploy script card on the app's page shows the install, build and migration commands Coresmith runs for the app's stack. You can replace them with your own.

Turn migrations off

For a stack with migrations, such as Laravel's php artisan migrate --force, the card has a Run migrations switch. It's on for new apps. Turn it off, and deploys skip the migration command, so you run migrations yourself when the schema changes. The change applies from the next deploy.

Write your script

  1. Choose Edit script on the Deploy script card.

  2. Write the commands, one per line. For example, to build an app in a folder of a larger repository:

    Terminal
    cd apps/web
    bun install --frozen-lockfile
    bun run build
  3. Save, then deploy.

Your script runs in the new release, before the health check and the switch. It has the app's runtimes and the credentials for private packages. The first command that fails stops the deploy, and the live release keeps serving.

Things to know

  • Migrations run only if your script runs them.
  • A deploy with your own script can't be cancelled partway, since the script might be running migrations.
  • The deploy's log shows your script as one step, Deploy script. When it fails, the log shows the exit code it stopped with, and the page links back to the script.

Go back to Coresmith's steps

Choose Use the default on the Deploy script card. The next deploy runs Coresmith's own steps again.