What is Bytebase
Bytebase is a start-up I currently take internship at. Its aspiration is to build an open-source, web-based database schema change and version control tool for team collaboration. We are a remote team and most of our development happens on GitHub.
We recently moved most of our hosted service to render.com and also leverage its unique capability to improve our dev workflow. I was responsible for this task.
Problems we faced
-
The demo page is stale
Our live demo page) was deployed on AWS EC2 . There is an extra step to manually update it during each release.
-
No staging environment for each release
We did not have a staging environment before each release. We want such a final testing stage after merging all works from different feature branches. Also, it would be great for our DevRel colleagues to taste our next release in advance.
-
No feature preview for PR
A running app worth a thousand words. As an open-source project with a fully-fledged web interface, we'd like to have a preview for every PR to facilitate the review process.
Render as a solution
From their website, render (https://render.com) is a unified cloud to build and run all your apps. Any app can be deployed and updated instantly with nearly no configuration. They boast their deployment velocity, and from our own experience, that's pretty true.
How do we use render?
Continuous deployment for our live demo
Bytebase employs monolithic architecture using Vue + Golang + SQLite. Our team adopts a trunk-based development workflow and we require our main branch to be deployable at every commit. We decided to use our demo site to validate this promise.
Configuring this on render is quite straightforward. Below are the steps to make our demo site deployed whenever new commits merge to our main branch.
-
Create a new web service
-
Link to our GitHub repo
-
Config our service
The free tier is good enough for us.
-
Specify our building and starting scripts
After the setup, our demo page is updated automatically whenever a new commit is merged into the main branch.
Staging environment for pre-release
Every pre-release will also trigger an update for our staging environment (staging.bytebase.com). (We can also update this environment manually via the action page)
Preview for each PR
To be honest, we didn't expect this simple to gain this capability, but after we finish the previous configuration steps, we just need to turn on a single switch to enable the PR preview feature. Once configured, render will post the preview link on every Pull Request. It usually takes a couple minutes to deploy the service when a new commit is pushed to the source branch and I add a 5-digits commit hash to tell the commit from which the service is built.