main
localhost:8080
.
<<YOURS>>.ngrok-free.app
.
https://<<YOURS>>.ngrok-free.app
.
https://<<YOURS>>.ngrok-free.app
as the External URL and click Confirm and update.
Workspace Admin
, and go to IAM & Admin > Users & Groups. Click + Add User, fill in with api-sample
, choose the Workspace DBA
role sufficient for this tutorial and click Confirm.
Sample Template
and click Next.
Prod
environment as the attached resources and click Confirm. Now the SQL review is enabled for the Prod
environment.
pipelines
folder from https://dev.azure.com/bytebase-hq/_git/bytebase-example. There are two workflows in this repository:
pipelines/sql-review.yml
: Lint the SQL migration files after the PR is created.pipelines/rollout-release.yml
: Create a release in Bytebase after the PR is merged to the main
branch.pipelines/sql-review.yml
and pipelines/rollout-release.yml
. In the env
section, replace the variable values with your own and commit the changes.
api-example@service.bytebase.com
(the service account you created in the previous step)projects/project-sample
(the sample project in the Bytebase)instances/test-sample-instance/databases/hr_test,instances/prod-sample-instance/databases/hr_prod
(the two default databases in the sample project)migrations/*.sql
(the pattern of the migration files)main
branch, add check-release
as a required check. You don’t need to add rollout-release
as a required check because it will be triggered automatically when the PR is merged.
pipelines/rollout-release.yml
, pay attention to BYTEBASE_TARGETS
in deploy-to-test
stage. You should put all the databases including both Test
and Prod
environments. NOT ONLY the Test
database.
202503131500_create_table_t1_ddl.sql
.migrations
directory:
check-release
workflow will be triggered. There will be a warning in the SQL review result.
rollout-release
workflow will be triggered to create a release in Bytebase and then roll out automatically.