Skip to content

Commit ba1f410

Browse files
committed
docs(scm): add Bitbucket configuration guide
Signed-off-by: Ushira Dineth <[email protected]>
1 parent 72da69d commit ba1f410

File tree

1 file changed

+62
-10
lines changed

1 file changed

+62
-10
lines changed

docs/getting-started.md

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Getting Started
22

3-
This guide will help you get started installing and setting up the GitOps Promoter. We currently only support
4-
GitHub, GitHub Enterprise, GitLab and Forgejo (including Codeberg) as the SCM providers. We would welcome any contributions to add support for other providers.
3+
This guide will help you get started installing and setting up the GitOps Promoter. We currently support
4+
GitHub, GitHub Enterprise, GitLab, Bitbucket, and Forgejo (including Codeberg) as the SCM providers. We would welcome any contributions to add support for other providers.
55

66
## Requirements
77

@@ -23,7 +23,6 @@ kubectl apply -f https://github.com/argoproj-labs/gitops-promoter/releases/downl
2323
You will need to [create a GitHub App](https://docs.github.com/en/developers/apps/creating-a-github-app) and configure
2424
it to allow the GitOps Promoter to interact with your GitHub repository.
2525

26-
2726
During the creation the GitHub App, you will need to configure the following settings:
2827

2928
### Permissions
@@ -38,8 +37,8 @@ During the creation the GitHub App, you will need to configure the following set
3837

3938
> [!NOTE]
4039
> We do support configuration of a GitHub App webhook that triggers PR creation upon Push. However, we do not configure
41-
> the ingress to allow GitHub to reach the GitOps Promoter. You will need to configure the ingress to allow GitHub to reach
42-
> the GitOps Promoter via the service promoter-webhook-receiver which listens on port `3333`. If you do not use webhooks
40+
> the ingress to allow GitHub to reach the GitOps Promoter. You will need to configure the ingress to allow GitHub to reach
41+
> the GitOps Promoter via the service promoter-webhook-receiver which listens on port `3333`. If you do not use webhooks
4342
> you might want to adjust the auto reconciliation interval to a lower value using these `promotionStrategyRequeueDuration` and
4443
> `changeTransferPolicyRequeueDuration` fields of the `ControllerConfiguration` resource.
4544
@@ -89,7 +88,7 @@ stringData:
8988
> [!NOTE]
9089
> This Secret will need to be installed to the same namespace that you plan on creating PromotionStrategy resources in.
9190
92-
We also need a GitRepository and ScmProvider, which are custom resources that represent a git repository and a provider.
91+
We also need a GitRepository and ScmProvider, which are custom resources that represent a git repository and a provider.
9392
Here is an example of both resources:
9493
9594
```yaml
@@ -119,11 +118,11 @@ spec:
119118
> [!IMPORTANT]
120119
> Make sure your staging branches (`environment/development-next`, `environment/staging-next`, etc.) are not auto-deleted
121120
> when PRs are merged. You can do this either by disabling auto-deletion of branches in the repository settings (in
122-
> Settings > Automatically delete head branches) or by adding a branch protection rule for a matching pattern such as
121+
> Settings > Automatically delete head branches) or by adding a branch protection rule for a matching pattern such as
123122
> `environment/*-next` (`/` characters are separators in GitHub's glob implementation, so `*-next` will not work).
124123

125124
> [!NOTE]
126-
> The GitRepository and ScmProvider also need to be installed to the same namespace that you plan on creating PromotionStrategy
125+
> The GitRepository and ScmProvider also need to be installed to the same namespace that you plan on creating PromotionStrategy
127126
> resources in, and it also needs to be in the same namespace of the secret it references.
128127

129128
## GitLab Configuration
@@ -140,7 +139,7 @@ stringData:
140139
token: <your-access-token>
141140
```
142141

143-
We also need a GitRepository and ScmProvider, which is are custom resources that represents a git repository and a provider.
142+
We also need a GitRepository and ScmProvider, which is are custom resources that represents a git repository and a provider.
144143
Here is an example of both resources:
145144

146145
```yaml
@@ -220,10 +219,63 @@ spec:
220219
name: <your-scmprovider-name> # The secret that contains the GitLab Access Token
221220
```
222221

222+
## Bitbucket Configuration
223+
224+
To configure the GitOps Promoter with Bitbucket, you will need to create a repository access token with the appropriate permissions and configure the necessary resources to allow the promoter to interact with your repository.
225+
226+
### Creating a Bitbucket Repository Access Token
227+
228+
1. Navigate to your repository URL
229+
2. Click on "Repository settings" in the sidebar
230+
3. Navigate to "Access tokens"
231+
4. Click "Create access token"
232+
5. Give it a name (e.g., "GitOps Promoter")
233+
6. Select the following permissions:
234+
* **Repositories**: Read and Write
235+
* **Pull requests**: Read and Write
236+
237+
### Configuration
238+
239+
This access token should be used in a secret as follows:
240+
241+
```yaml
242+
apiVersion: v1
243+
kind: Secret
244+
metadata:
245+
name: <your-secret-name>
246+
type: Opaque
247+
stringData:
248+
token: <your-repository-access-token>
249+
```
250+
251+
We also need a GitRepository and ScmProvider, which are custom resources that represent a git repository and a provider.
252+
Here is an example of both resources:
253+
254+
```yaml
255+
apiVersion: promoter.argoproj.io/v1alpha1
256+
kind: ScmProvider
257+
metadata:
258+
name: <your-scmprovider-name>
259+
spec:
260+
secretRef:
261+
name: <your-secret-name>
262+
bitbucket: {}
263+
---
264+
apiVersion: promoter.argoproj.io/v1alpha1
265+
kind: GitRepository
266+
metadata:
267+
name: <git-repository-ref-name>
268+
spec:
269+
bitbucket:
270+
workspace: <workspace-name>
271+
repository: <repo-name>
272+
scmProviderRef:
273+
name: <your-scmprovider-name>
274+
```
275+
223276
> [!NOTE]
224277
> The GitRepository and ScmProvider also need to be installed to the same namespace that you plan on creating PromotionStrategy resources in, and it also needs to be in the same namespace of the secret it references.
225278

226-
227279
## Promotion Strategy
228280

229281
The PromotionStrategy resource is the main resource that you will use to configure the promotion of your application to different environments.

0 commit comments

Comments
 (0)