Staging and rolling back
Catch offers a convenient method to stage changes before deployment and the capability to roll back to a previous state.
Staging is especially useful when deploying multiple changes together, such as a new binary and updated environment variables.
When Catch performs a rollback, it restores not only the previous service but also the managed environment variables and service configuration.
Staging changes
Staging a new binary
We use scp
to stage a new binary for our service. Catch special-cases the stage
filename to automatically stage.
scp my-binary my-service@catch:stage
Staging a Docker image
We can also stage a new Docker image for our service using the yeet push
command.
yeet push my-service my-docker-image
When we push a new Docker image, the latest
tag in the internal Catch registry is updated to point to our new image.
Staging environment variables
To stage environment variables, use scp
and upload our environment variables file.
scp my-env.txt my-service@catch:stage/env
Your environment variables will be applied the next time we deploy our service or we can manually apply them using
yeet stage my-service commit
.
Commiting changes
We use yeet stage <service> commit
to commit any changes we have staged. This will update our service and deploy it.
yeet stage my-service commit
Rolling back
To revert to a previous state, use the yeet rollback
command. This command will restore the service, environment variables, and service configuration to their previous state.
yeet rollback my-service
Catch preserves the last 10 generations of our service.