Skip to content

Commit 25ce4f1

Browse files
committed
docs: gitops with api
1 parent 5d24232 commit 25ce4f1

File tree

5 files changed

+68
-36
lines changed

5 files changed

+68
-36
lines changed

content/docs/_layout.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,23 @@ expand_section_list: ['Self-host']
139139

140140
### [Overview](/vcs-integration/overview)
141141

142-
### [Add Git Provider](/vcs-integration/add-git-provider)
142+
### Simple GitOps
143143

144-
### [Add GitOps Connector in Project](/vcs-integration/add-gitops-connector)
144+
#### [Overview](/vcs-integration/simple/overview)
145145

146-
### [Create Migration Files](/vcs-integration/create-migration-files)
146+
#### [Add Git Provider](/vcs-integration/add-git-provider)
147147

148-
### [Troubleshoot 🐞](/vcs-integration/troubleshoot)
148+
#### [Add GitOps Connector in Project](/vcs-integration/add-gitops-connector)
149+
150+
#### [Create Migration Files](/vcs-integration/create-migration-files)
151+
152+
#### [Troubleshoot 🐞](/vcs-integration/troubleshoot)
153+
154+
### Custom GitOps
155+
156+
#### [Overview](/vcs-integration/custom/overview)
157+
158+
#### [Release](/vcs-integration/custom/release)
149159

150160
## SQL Editor
151161

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Custom GitOps
3+
---
4+
5+
If the built-in [simple GitOps](/docs/vcs-integration/simple/overview/) is not sufficient, you can opt to [Bytebase API](/docs/api/overview/) to fully customize the GitOps workflow to integrate with your CI pipeline.
6+
7+
<TutorialBlock url="/docs/tutorials/github-ci/" title="Automating Database Schema Change workflow Using GitHub Actions" />
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Release
3+
---
4+
5+
A `release` is a deployable unit that encapsulates a set of SQL statements.
6+
7+
You can think of a `release` as a collection of SQL statements layered on top of a scratch Docker image.
8+
9+
In your CI/CD pipeline, a Docker image is built from the source code and sent to the CD system for deployment. Similarly, your CI pipeline creates a `release` by invoking the Bytebase API. Once built, the `release` can be deployed to the database either via the Bytebase UI or through the Bytebase API.
10+
11+
<HintBlock type="info">
12+
13+
Like a Docker image, a `release` is immutable after it is created.
14+
15+
</HintBlock>
Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,16 @@
11
---
2-
title: GitOps with VCS Integration
2+
title: GitOps
33
---
44

5-
## Built-in GitOps
5+
Bytebase offers a database-as-code workflow, enabling you to manage database changes directly through your version control system (VCS).
66

7-
### Prerequisites
7+
Bytebase provides two GitOps workflows:
88

9-
- Configure [External URL](/docs/get-started/install/external-url).
10-
- VCS and Bytebase are network reachable from each other.
11-
- VCS needs to push webhook to Bytebase.
12-
- Bytebase needs to fetch file content from VCS.
13-
14-
### Workflow
15-
16-
![gitops-workflow](/content/docs/vcs-integration/overview/gitops-workflow.webp)
17-
18-
The built-in Bytebase GitOps workflow is **opinionated** for the typical use case:
19-
20-
- It imposes a [naming convention on the migration file](/docs/vcs-integration/create-migration-files/).
21-
- It only creates Bytebase rollout issue when the migration file is **merged** into the target branch.
22-
Under the hood, it creates a webhook in the linked repository to observe the merge event.
23-
- If you have successfully rolled out the issue and you want to make further change based on that migration file, you need to create a new migration file instead of editing the original one inline.
9+
- [Simple GitOps](/docs/vcs-integration/simple/overview): Opinionated and restricted for the simple use case.
10+
- [Custom GitOps](/docs/vcs-integration/custom/overview): Fully customizable via the Bytebase API.
2411

2512
<HintBlock type="info">
2613

27-
You can check this [demo issue](https://demo.bytebase.com/projects/gitops-project/issues/106) to see what it looks like after the setup. This issue is created by Bytebase after the [PR is merged](https://github.com/s-bytebase/hr-sample/pull/17).
14+
If you manage database changes for multiple teams or have any branching strategy beyond the most basic, you will be likely need the [Custom GitOps](/docs/vcs-integration/custom/overview) workflow.
2815

2916
</HintBlock>
30-
31-
The built-in GitOps setup contains 3 steps:
32-
33-
1. [Add Git Provider](/docs/vcs-integration/add-git-provider)
34-
1. [Add GitOps Connector in Project](/docs/vcs-integration/add-gitops-connector)
35-
1. [Create Migration Files](/docs/vcs-integration/create-migration-files)
36-
37-
## Custom GitOps with API
38-
39-
If the built-in workflow is not suitable, you can opt to [Bytebase API](/docs/api/overview/) to fully customize the GitOps workflow to
40-
integrate with your CI pipeline.
41-
42-
<TutorialBlock url="/docs/tutorials/github-ci/" title="Automating Database Schema Change workflow Using GitHub Actions" />
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: Simple GitOps
3+
---
4+
5+
Bytebase provides a built-in GitOps workflow out of the box.
6+
7+
![gitops-workflow](/content/docs/vcs-integration/overview/gitops-workflow.webp)
8+
9+
This GitOps workflow is opinionated for the simple use case:
10+
11+
- It imposes a [naming convention on the migration file](/docs/vcs-integration/create-migration-files/).
12+
- It only creates Bytebase rollout issue when the migration file is **merged** into the target branch.
13+
Under the hood, it creates a webhook in the linked repository to observe the merge event.
14+
- If you have successfully rolled out the issue and you want to make further change based on that migration file, you need to create a new migration file instead of editing the original one inline.
15+
16+
<HintBlock type="info">
17+
18+
You can check this [demo issue](https://demo.bytebase.com/projects/gitops-project/issues/106) to see what it looks like after the setup. This issue is created by Bytebase after the [PR is merged](https://github.com/s-bytebase/hr-sample/pull/17).
19+
20+
</HintBlock>
21+
22+
The simple GitOps setup contains 3 steps:
23+
24+
1. [Add Git Provider](/docs/vcs-integration/add-git-provider)
25+
1. [Add GitOps Connector in Project](/docs/vcs-integration/add-gitops-connector)
26+
1. [Create Migration Files](/docs/vcs-integration/create-migration-files)

0 commit comments

Comments
 (0)