New — Iris AI drafts your firewall, routing & rate-limit rules. Explore AI features →
Changelog
Apps

Release command: run your migrations before a deploy goes live

Backend and full-stack apps can run a command once with each deploy, before it goes live. If it fails, the deploy stops and your current version keeps serving.

Your backend's database has to be ready before its new version takes traffic. A release command does that step for you: ngris runs it once with each new deploy, after the build and before anything changes for your visitors.

What's new

  • A Release command setting on the Settings tab of backend and full-stack apps, and release_command on PUT /v1/applications/{uuid} and in the MCP server's app_settings_set. For example python manage.py migrate --noinput, npm run migrate or bin/rails db:migrate.
  • It runs with the new version. One copy of the new version starts with all your app's environment variables, secrets and databases, and runs the command with a shell.
  • A failure keeps your current version live. If the command exits with an error, can't start, or is still running at your plan's time limit, the deploy fails and the previous version keeps serving. The deploy shows what happened, for example Release command failed (exit 1), with the last 50 lines of the command's output. The values of your secret variables are hidden in it.
  • Once per deploy. A rollback to a version that was live before, a restart or a change of environment variables doesn't run it again.

Get started

  1. Open your app's Settings tab and type your command under Release command. Settings shows your plan's time limit.
  2. Make the command safe to run twice: use a migration tool that records what it has applied, and change your schema so the version that is live keeps working.
  3. Deploy. The release command runs before the new version goes live.
  4. Read the docs: Release command.

Read the docs

Ask an AI to summarise this page
Deploy
App hosting Edge functions Domains & certificates
Connect
Secure tunnels API gateway Multi-region edge
Protect
Bot protection & challenge WAF & firewall Edge login
Observe & AI
Monitoring Inspector & replay Iris AI MCP server AI Gateway
Developers
Developer tools Docs ngrok policy converter Blog Changelog
Compare
Ngris vs ngrok Ngris vs Cloudflare Tunnel Ngris vs Vercel Ngris vs Netlify Expose localhost guide
More
Solutions Pricing Enterprise Sign in Get Started Free