We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Tue, December 24, 2024
Rolling back to a Commit

"To err is human, to forgive divine". We're all humans after all and from time to time we make mistakes. It's important that the tools we use offer us safety net. If you've ever used heavy machinery like a saw, you'd see all the new saws have something called SawStop. I believe software should be the same.
This feature is something that has been asked by many of our users, in the case where a mistake is pushed into production having the ability to quickly rollback will enable us to get back to a working state quickly.
How it works
To check out the rollback feature you can head over to the installation detail page. You should be able to click on the commit.
This will open up the commit history.
You can click on a commit you want to deploy and simply click Change
.
Tracking Progress
Once you choose a commit you'll be taken to the operation page. This allows you to track the procedure.
Once the operation completes you can click to go back to the installation detail. You'll notice that the channel has now changed and the installation channel now tracks a specific commit.
This means that any further pushes to your branch will no longer update the installation. This also means that you can lock a given installation to a specific tag, since tags are attached to a specific commit. This is by design.
Once you have resolved your issues on your branch, you can switch your installation back to update on pushing to a given branch by changing the channel.
Tracking Branch Deployments
To switch back to deploy on pushing to a given branch, you can click on the channel and this will open up the screen to allow you to select a channel.
This operation is as simple as selecting the desired channel and clicking Change
. You'll be taken to the operation tracking screen and once it completes you can go back to the installation page.
Instance bootstrapping
Each time you change the commit or the channel Opsmaru will take down the old instance and bootstrap a new instance. If you want to see which commit or channel it's tracking you can take a look at the logs. You'll see something like the following.
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/x86_64/APKINDEX.tar.gz
fetch http://uplink-e8311b54-01:4080/distribution/26e401218d00607e2575fadbde553cfbe95f22e1/upmaru-stage/laraone/x86_64/APKINDEX.tar.gz
v3.20.3-440-gfd1129d1e18 [https://dl-cdn.alpinelinux.org/alpine/v3.20/main]
v3.20.3-439-gb27d799af76 [https://dl-cdn.alpinelinux.org/alpine/v3.20/community]
upmaru-stage [http://uplink-e8311b54-01:4080/distribution/26e401218d00607e2575fadbde553cfbe95f22e1/upmaru-stage/laraone]
OK: 24178 distinct packages available
If your instance is tracking a given commit you'll see the /distribution/
url track the specific commit. If it's tracking a branch / channel you'll see the branch name.
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/x86_64/APKINDEX.tar.gz
fetch http://uplink-e8311b54-01:4080/distribution/master/upmaru-stage/laraone/x86_64/APKINDEX.tar.gz
v3.20.3-440-gfd1129d1e18 [https://dl-cdn.alpinelinux.org/alpine/v3.20/main]
v3.20.3-439-gb27d799af76 [https://dl-cdn.alpinelinux.org/alpine/v3.20/community]
upmaru-stage [http://uplink-e8311b54-01:4080/distribution/master/upmaru-stage/laraone]
OK: 24178 distinct packages available
Wrap up
It's important to note that this feature will only rollback your application instance. If you have deployments that run database migrations that may break previous commits you will need to be careful. Rolling back will not automatically rollback your migrations.
If you have complex migrations that break previous commits it might be important to consider whether patching and pushing an update might be better than rolling back.
That's it for this post. We hope you like how this feature is implemented. As usual we're always listening for feedback. Please let us know how you find the rollback feature.