This feature is currently in preview, reach out to our support team to request access.
Post-deploy commands are useful to run a command or script after deploying, for example busting a cache. After a successful deploy, we spin up a dedicated container to run the command and shut down the container after the command finishes.
Two Flightcontrol services support post-deploy command:
fargate-worker. The command runs in the
basePath directory of your application.
If the post-deploy command fails, the dashboard will show a deployment error, but the new code will remain deployed. We do not automatically rollback if the post-deploy command fails.
Limitation: at the moment post-deploy is only supported when using the Nixpacks build type or
pre-built images that do not have a long running
Post-deploy command can be configured as a service configuration parameter for
If you are using the dashboard to configure your project, set the command as shown in the screenshot.
If you are using the
flightcontrol.json file to configure your app, add a new parameter
postDeployCommand to your service object.
"postDeployCommand": "pnpm run bust-cache"
... // remaining service config
You can turn on email or Slack notifications for post-deploy command failures in organization settings.