Skip to content

Commit 71b6649

Browse files
committed
chore: minor tweak
1 parent a184fcd commit 71b6649

File tree

6 files changed

+39
-64
lines changed

6 files changed

+39
-64
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Since you will need to run SQL review on your PRs, you need to configure the SQL review in Bytebase.
2+
3+
1. Go to **CI/CD** > **SQL Review**, click **Create SQL Review**.
4+
5+
1. Select the `Sample Template` and click **Next**.
6+
![bb-sql-review-sample](/content/docs/tutorials/share/bb-sql-review-sample.webp)
7+
8+
1. Select `Prod` environment as the attached resources and click **Confirm**. Now the SQL review is enabled for the `Prod` environment.
9+
![bb-sql-review-prod](/content/docs/tutorials/share/bb-sql-review-prod.webp)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<IncludeBlock url="/docs/share/tutorials/create-service-account"></IncludeBlock>
2+
3+
If you have **Enterprise Plan**, you can create a **Custom Role** for the service account which require fewer permissions, and assign this role instead of DBA:
4+
5+
- plans.create
6+
- plans.get
7+
- plans.preview
8+
- releases.check
9+
- releases.create
10+
- releases.get
11+
- rollouts.create
12+
- rollouts.get
13+
- rollouts.list
14+
- sheets.create
15+
- sheets.get
16+
- taskRuns.create
17+
- planCheckRuns.list
18+
- planCheckRuns.run

content/docs/tutorials/gitops-azure-devops-workflow.md

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@ This is one of our database GitOps series with Bytebase:
1717

1818
---
1919

20-
This tutorial shows you how to build an database GitOps workflow using Azure DevOps Pipeline and Bytebase API. You'll learn to:
20+
This tutorial shows you how to build a database GitOps workflow using Azure DevOps Pipeline and Bytebase API. You'll learn to create a streamlined database release workflow where you can:
2121

22-
1. Create a streamlined database release workflow where you can:
23-
24-
- Submit SQL migrations through Azure DevOps
25-
- Automatically run SQL reviews on pull requests
26-
- Auto-create and deploy Bytebase releases when merging to `main`
22+
- Submit SQL migrations through Azure DevOps
23+
- Automatically run SQL reviews on pull requests
24+
- Auto-create and deploy Bytebase releases when merging to `main`
2725

2826
While we use Azure DevOps Pipeline in this guide, you can apply these concepts to other CI platforms like [GitHub Actions](/docs/tutorials/gitops-github-workflow), GitLab CI, or Bitbucket Pipelines using the Bytebase API.
2927

3028
<HintBlock type="info">
3129

32-
This tutorial code repository is at [https://dev.azure.com/bytebase-hq/_git/bytebase-example](https://dev.azure.com/bytebase-hq/_git/bytebase-example)
30+
This tutorial code repository is at [https://dev.azure.com/bytebase-hq/\_git/bytebase-example](https://dev.azure.com/bytebase-hq/_git/bytebase-example)
3331

3432
</HintBlock>
3533

@@ -46,40 +44,15 @@ This tutorial code repository is at [https://dev.azure.com/bytebase-hq/_git/byte
4644

4745
### Step 2 - Create Service Account
4846

49-
<IncludeBlock url="/docs/share/tutorials/create-service-account"></IncludeBlock>
50-
51-
If you have **Enterprise Plan**, you can create a **Custom Role** for the service account which require fewer permissions, and assign this role instead of DBA:
52-
53-
- plans.create
54-
- plans.get
55-
- plans.preview
56-
- releases.check
57-
- releases.create
58-
- releases.get
59-
- rollouts.create
60-
- rollouts.get
61-
- rollouts.list
62-
- sheets.create
63-
- sheets.get
64-
- taskRuns.create
65-
- planCheckRuns.list
66-
- planCheckRuns.run
47+
<IncludeBlock url="/docs/share/tutorials/create-service-account-gitops"></IncludeBlock>
6748

6849
### Step 3 - Configure SQL Review in Bytebase
6950

70-
Since you will need to run SQL review on your PRs, you need to configure the SQL review in Bytebase.
71-
72-
1. Go to **CI/CD** > **SQL Review**, click **Create SQL Review**.
73-
74-
1. Select the `Sample Template` and click **Next**.
75-
![bb-sql-review-sample](/content/docs/tutorials/gitops-github-workflow/bb-sql-review-sample.webp)
76-
77-
1. Select `Prod` environment as the attached resources and click **Confirm**. Now the SQL review is enabled for the `Prod` environment.
78-
![bb-sql-review-prod](/content/docs/tutorials/gitops-github-workflow/bb-sql-review-prod.webp)
51+
<IncludeBlock url="/docs/share/tutorials/config-sql-review"></IncludeBlock>
7952

8053
### Step 4 - Copy from the Example Repository and Configure Variables
8154

82-
1. Create a new project. Copy `pipelines` folder from [https://dev.azure.com/bytebase-hq/_git/bytebase-example](https://dev.azure.com/bytebase-hq/_git/bytebase-example). There are two workflows in this repository:
55+
1. Create a new project. Copy `pipelines` folder from [https://dev.azure.com/bytebase-hq/\_git/bytebase-example](https://dev.azure.com/bytebase-hq/_git/bytebase-example). There are two workflows in this repository:
8356

8457
- `pipelines/check-release.yml`: [Lint the SQL](/docs/sql-review/overview/) migration files after the PR is created.
8558
- `pipelines/rollout-release.yml`: Create a release in Bytebase after the PR is merged to the `main` branch.
@@ -119,7 +92,7 @@ To create migration files to trigger release creation, the files have to match t
11992
1. Commit to a new branch and create a pull request, the `check-release` workflow will be triggered. There will be a warning in the SQL review result.
12093

12194
![ad-check-pass](/content/docs/tutorials/gitops-azure-devops-workflow/ad-check-pass.webp)
122-
95+
12396
![ad-check-warning](/content/docs/tutorials/gitops-azure-devops-workflow/ad-check-warning.webp)
12497

12598
1. According to the SQL review result, you can do some changes to the SQL files and push to the branch. Then you should see the SQL review has passed. There are no warnings in the SQL review result.
@@ -128,7 +101,7 @@ To create migration files to trigger release creation, the files have to match t
128101
CREATE TABLE t1 (
129102
id SERIAL PRIMARY KEY,
130103
name TEXT NOT NULL
131-
);
104+
);
132105
```
133106

134107
![ad-check-no-warning](/content/docs/tutorials/gitops-azure-devops-workflow/ad-check-no-warning.webp)

content/docs/tutorials/gitops-github-workflow.md

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,36 +42,11 @@ https://github.com/bytebase/example-gitops-github-flow
4242

4343
### Step 2 - Create Service Account
4444

45-
<IncludeBlock url="/docs/share/tutorials/create-service-account"></IncludeBlock>
46-
47-
If you have **Enterprise Plan**, you can create a **Custom Role** for the service account which require fewer permissions, and assign this role instead of DBA:
48-
49-
- plans.create
50-
- plans.get
51-
- plans.preview
52-
- releases.check
53-
- releases.create
54-
- releases.get
55-
- rollouts.create
56-
- rollouts.get
57-
- rollouts.list
58-
- sheets.create
59-
- sheets.get
60-
- taskRuns.create
61-
- planCheckRuns.list
62-
- planCheckRuns.run
45+
<IncludeBlock url="/docs/share/tutorials/create-service-account-gitops"></IncludeBlock>
6346

6447
### Step 3 - Configure SQL Review in Bytebase
6548

66-
Since you will need to run SQL review on your PRs, you need to configure the SQL review in Bytebase.
67-
68-
1. Go to **CI/CD** > **SQL Review**, click **Create SQL Review**.
69-
70-
1. Select the `Sample Template` and click **Next**.
71-
![bb-sql-review-sample](/content/docs/tutorials/gitops-github-workflow/bb-sql-review-sample.webp)
72-
73-
1. Select `Prod` environment as the attached resources and click **Confirm**. Now the SQL review is enabled for the `Prod` environment.
74-
![bb-sql-review-prod](/content/docs/tutorials/gitops-github-workflow/bb-sql-review-prod.webp)
49+
<IncludeBlock url="/docs/share/tutorials/config-sql-review"></IncludeBlock>
7550

7651
### Step 4 - Fork the Example Repository and Configure Variables
7752

public/content/docs/tutorials/gitops-github-workflow/bb-sql-review-prod.webp renamed to public/content/docs/tutorials/share/bb-sql-review-prod.webp

File renamed without changes.

public/content/docs/tutorials/gitops-github-workflow/bb-sql-review-sample.webp renamed to public/content/docs/tutorials/share/bb-sql-review-sample.webp

File renamed without changes.

0 commit comments

Comments
 (0)