bytebase-action
helps to do common chores in database CI/CD with Bytebase.
This action provides several subcommands to interact with Bytebase.
check
Usage: bytebase-action check [global flags]
Checks the SQL migration files matching the --file-pattern
. This is typically used for linting or pre-deployment validation within a CI pipeline. It utilizes global flags like --url
, --service-account
, --service-account-secret
, and --file-pattern
.
rollout
Usage: bytebase-action rollout [global flags] [rollout flags]
Creates a new release and initiates a rollout issue in the specified Bytebase --project
.
If a --plan
is specified, it rolls out that specific plan.
Otherwise, it applies the SQL migration files matching the --file-pattern
to the defined --targets
.
The rollout will proceed up to the specified --target-stage
.
It uses global flags for connection and file discovery (unless a plan is specified), and specific flags like --release-title
and --rollout-title
to name the created resources in Bytebase.
This action is configured via command-line flags. Global flags apply to all commands, while some commands have specific flags.
These flags apply to the main bytebase-action
command and its subcommands (check
, rollout
).
--output
: The output file location. The output file is a JSON file with the created resource names.
""
(empty string)--url
: The Bytebase instance URL.
https://demo.bytebase.com
--service-account
: The service account email.
ci@service.bytebase.com
--service-account-secret
: The service account password.
BYTEBASE_SERVICE_ACCOUNT_SECRET
environment variable. You can override this by providing the flag directly.BYTEBASE_SERVICE_ACCOUNT_SECRET
is the recommended way to handle the secret.--project
: The target Bytebase project name.
projects/{project}
projects/project-sample
--targets
: A comma-separated list or multiple uses of the flag specifying the target databases or database groups.
--plan
is not specified for the rollout
command.instances/{instance}/databases/{database}
projects/{project}/databaseGroups/{databaseGroup}
instances/test-sample-instance/databases/hr_test,instances/prod-sample-instance/databases/hr_prod
--file-pattern
: A glob pattern used to find SQL migration files.
check
and rollout
(when --plan
is not specified) to locate relevant files.""
(empty string)check
Command Specific FlagsThese flags are specific to the check
subcommand (bytebase-action check
).
--check-release
: Determines whether to fail the command based on check results.
SKIP
: Do not fail regardless of check results (default behavior).FAIL_ON_WARNING
: Fail if there are warnings or errors in the check results.FAIL_ON_ERROR
: Fail only if there are errors in the check results.SKIP
rollout
Command Specific FlagsThese flags are specific to the rollout
subcommand (bytebase-action rollout
).
--release-title
: The title of the release created in Bytebase.
2025-04-25T17:32:07+08:00
).--rollout-title
: The title of the rollout issue created in Bytebase.
2025-04-25T17:32:07+08:00
).--check-plan
: Determines whether to run plan checks and how to handle failures.
SKIP
: Do not run plan checks.FAIL_ON_WARNING
: Run plan checks and fail if there are warnings or errors.FAIL_ON_ERROR
: Run plan checks and fail only if there are errors.SKIP
--target-stage
: The target stage up to which the rollout should proceed. This flag is required for the rollout
command.
environments/{environment}
environments/prod
--plan
: The specific plan to rollout.
projects/{project}/plans/{plan}
--file-pattern
and --targets
flags, meaning they will be ignored.此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。