Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 0 additions & 109 deletions .github/workflows/release.yml

This file was deleted.

74 changes: 0 additions & 74 deletions .github/workflows/sql-review.yml

This file was deleted.

53 changes: 3 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ For GitHub flow, feature branches are merged into the main branch and the main b

[release-action.yml](/.github/workflows/release-action.yml) builds the code and then for each environment migrate the databases and deploy the code. Using [environments with protection rules](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-deployments/managing-environments-for-deployment#required-reviewers), it can deploy to the test environment automatically and push to the prod environment after approval.

## Use bytebase/bytebase-action (recommended)
## Use bytebase/bytebase-action

The README of bytebase/bytebase-action can be found at [README](https://github.com/bytebase/bytebase/blob/main/action/README.md).

Expand All @@ -26,7 +26,7 @@ Modify the environment variables to match your setup.
BYTEBASE_SERVICE_ACCOUNT_SECRET: ${{secrets.BYTEBASE_SERVICE_ACCOUNT_SECRET}}
BYTEBASE_PROJECT: "projects/project-sample"
BYTEBASE_TARGETS: "instances/test-sample-instance/databases/hr_test" # the database targets to check against.
FILE_PATTERN: "migrations/*.sql" # the glob pattern matching the migration files.
FILE_PATTERN: "migrations-semver/*.sql" # the glob pattern matching the migration files.
```

Set your service account password in the repository secrets setting with the name `BYTEBASE_SERVICE_ACCOUNT_SECRET`.
Expand All @@ -52,7 +52,7 @@ You need to edit both deploy-to-test and deploy-to-prod jobs.
# 'deploy_to_test' job rollouts the 'test' stage and 'deploy_to_prod' job rollouts the 'prod' stage.
BYTEBASE_TARGETS: "instances/test-sample-instance/databases/hr_test,instances/prod-sample-instance/databases/hr_prod"
BYTEBASE_TARGET_STAGE: environments/test
FILE_PATTERN: "migrations/*.sql"
FILE_PATTERN: "migrations-semver/*.sql"
```

In the repository environments setting, create two environments: "test" and "prod". In the "prod" environment setting, configure "Deployment protection rules", check "Required reviewers" and add reviewers in order to rollout the "prod" environment after approval.
Expand All @@ -61,50 +61,3 @@ Set your service account password in the repository secrets setting with the nam

> [!IMPORTANT]
> The migration filename SHOULD comply to the naming scheme described in [bytebase-action](https://github.com/bytebase/bytebase/tree/main/action#global-flags) `--file-pattern` flag section.

## Use javascript actions

### How to configure sql-review.yml

Copy [sql-review.yml](/.github/workflows/sql-review.yml) to your repository.

Modify the environment variables to match your setup.

```yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # set GITHUB_TOKEN because the 'Check release' step needs it to comment the pull request with check results.
BYTEBASE_URL: https://demo.bytebase.com
BYTEBASE_SERVICE_ACCOUNT: ci@service.bytebase.com
BYTEBASE_PROJECT: "projects/project-sample"
BYTEBASE_TARGETS: "instances/test-sample-instance/databases/hr_test" # the database targets to check against.
FILE_PATTERN: "migrations/*.sql" # the glob pattern matching the migration files.
```

Set your service account password in the repository secrets setting with the name `BYTEBASE_SERVICE_ACCOUNT_SECRET`.

> [!IMPORTANT]
> The migration filename SHOULD comply to the naming scheme described in [bytebase-action](https://github.com/bytebase/bytebase/tree/main/action#global-flags) `--file-pattern` flag section.

### How to configure release.yml

Copy [release.yml](/.github/workflows/release.yml) to your repository.

Modify the environment variables to match your setup.

```yml
env:
BYTEBASE_URL: https://demo.bytebase.com
BYTEBASE_SERVICE_ACCOUNT: ci@service.bytebase.com
BYTEBASE_PROJECT: "projects/project-sample"
# The Bytebase rollout pipeline will deploy to 'test' and 'prod' environments.
# 'deploy_to_test' job rollouts the 'test' stage and 'deploy_to_prod' job rollouts the 'prod' stage.
BYTEBASE_TARGETS: "instances/test-sample-instance/databases/hr_test,instances/prod-sample-instance/databases/hr_prod"
FILE_PATTERN: "migrations/*.sql" # the glob pattern matching the migration files.
```

In the repository environments setting, create two environments: "test" and "prod". In the "prod" environment setting, configure "Deployment protection rules", check "Required reviewers" and add reviewers in order to rollout the "prod" environment after approval.

Set your service account password in the repository secrets setting with the name `BYTEBASE_SERVICE_ACCOUNT_SECRET`.

> [!IMPORTANT]
> The migration filename SHOULD comply to the naming scheme described in [bytebase-action](https://github.com/bytebase/bytebase/tree/main/action#global-flags) `--file-pattern` flag section.
4 changes: 0 additions & 4 deletions migrations/202503071616_create_ticket_table.sql

This file was deleted.

1 change: 0 additions & 1 deletion migrations/202503181018_ticket_table_add_date_column.sql

This file was deleted.

1 change: 0 additions & 1 deletion migrations/202503181054_1.sql

This file was deleted.

1 change: 0 additions & 1 deletion migrations/202503181055_2.sql

This file was deleted.

3 changes: 0 additions & 3 deletions migrations/202504171429_1.sql

This file was deleted.

3 changes: 0 additions & 3 deletions migrations/202504171526_2.sql

This file was deleted.

3 changes: 0 additions & 3 deletions migrations/202504301754_1.sql

This file was deleted.