Add a Pre-Deploy Command

Pre-deploy commands execute between building and deploying your application, handling tasks like database migrations or data seeding before your application runs. They execute within your private network and have access to your application's environment variables.

If your command fails, it will not be retried and the deployment will not proceed.

Screenshot of pre-deploy command configuration

For pre-deploy commands to work correctly, ensure that:

  • It exits with a status code of 0 to indicate success or non-zero to indicate failure.
  • It runs in a reasonable amount of time. It will occupy a slot in your build queue.
  • It does not rely on the application running.
  • It has the dependencies it needs to run installed in the application image.

Edit this file on GitHub