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.
Prod
environment as above. In this demo, we would switch to enable it for Test
to fit the following GitLab CI workflow.
.gitlab-ci.yml
: The CI pipeline for the repository which includes the SQL review and release creation.bytebase-review.yml
: Lint the SQL migration files after the MR is created.bytebase-rollout.yml
: Create a release in Bytebase after the MR is merged to the main
branch.bytebase-review.yml
and bytebase-rollout.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)bytebase-rollout.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.
202505121650_create_table_t1.sql
.ddl
or dml
to indicate its change type. If it doesn’t end with any of the two, its change type is DDL by default.migration
directory:
sql-review
pipeline will be triggered. There will be a warning in the SQL review result.
release
pipeline will be triggered to create a release in Bytebase and then roll out automatically.
deploy-to-test
and expand the logs, you can follow the links to Bytebase.
bytebase-action
in an Offline GitLab RunnerJob failed: failed to pull image "bytebase/bytebase-action:latest"
. Since the image cannot be pulled directly from Docker Hub, you’ll need to download it from an external machine, then transfer and load it into your internal environment manually.
bytebase-action.tar
file to your internal server.
Use scp
, USB drive, or any method suitable for your setup.
bytebase-action
may fail with:
clone_url
in your GitLab Runner configuration to point to the internal GitLab address: