Deployments and rollbacks
Copy page
A deployment is one version of your project going live. grayspar deploy creates one, and so do saving a variable, adding or removing a volume, and rolling back from the dashboard.
What happens during a deployment
Section titled “What happens during a deployment”A deployment moves through Queued, Building and Deploying, and the CLI shows each step. A code deploy builds each service it deploys, and the build reuses cached steps from earlier builds. Changing a variable builds a service again only when its build reads that variable, so most variable changes go live without a build.
A service with no volume switches to its new copy once the copy has started, so people using your app see no downtime. A service with a volume restarts in place.
If a build fails or a new copy doesn’t start, the deployment fails and the version already running stays live. grayspar deploy names the service that failed and exits with code 1. Troubleshooting covers the common causes.
To try a failed deployment again, open it in the dashboard and press Retry. Grayspar builds the same code again with each service’s current settings and variables, and keeps any build that already succeeded. Only the newest deployment can be retried.
If you deploy again while a deployment is still building, the newer one replaces it, and the earlier command stops with a message saying so. A deployment that has started going live finishes first, and the newer one waits for it.
Pressing Ctrl+C stops the CLI’s output, and the deployment carries on. To check its progress, run grayspar status.
Roll back to an earlier deployment
Section titled “Roll back to an earlier deployment”To go back to an earlier version, roll back to its deployment from the dashboard:
- Open your project in the dashboard, then open Deployments.
- Open the deployment you want to go back to.
- Press Roll back.
Grayspar starts a new deployment on the same builds and with the same variables that deployment ran with, so both your code and your variables go back. A volume keeps its current data, because a volume isn’t part of a deployment. The CLI has no command for rolling back.
You can’t roll back to a deployment that failed or was cancelled, because its version never went live.
Grayspar keeps a project’s five newest deployments and any deployment that is running. Grayspar deletes older deployments after a period set by your plan.
Who can deploy
Section titled “Who can deploy”Owners and members of a team can deploy and roll back. A viewer can see the list of deployments and can’t change anything.