Skip to content

Commit baf9c3c

Browse files
committed
feat: Rename Gitea to Foregjo in docs
Added documentation and configuration details for integrating with Forgejo, a community-driven Git forge. This includes a new installation guide for Forgejo, updates to existing documentation to reflect Forgejo support, and modifications to the support matrix shortcode to include Forgejo. The changes ensure that users can now leverage Pipelines-as-Code with Forgejo repositories. We still have the providers and internals as Gitea for now to don't make this too much of a change. Jira: https://issues.redhat.com/browse/SRVKP-9993 Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
1 parent d667b63 commit baf9c3c

File tree

13 files changed

+203
-46
lines changed

13 files changed

+203
-46
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Pipelines-as-Code is an opinionated CI/CD solution for Tekton and OpenShift Pipe
1010

1111
## Overview
1212

13-
Pipelines-as-Code brings the [Pipelines-as-Code methodology](https://teamhub.com/blog/understanding-pipeline-as-code-in-software-development/) to Tekton. It provides a simple and declarative way to define your pipelines in your Git repository and have them automatically executed on your Kubernetes cluster. It integrates seamlessly with Git providers like GitHub, GitLab, Bitbucket, and Gitea, and provides feedback directly on your pull requests and commits.
13+
Pipelines-as-Code brings the [Pipelines-as-Code methodology](https://teamhub.com/blog/understanding-pipeline-as-code-in-software-development/) to Tekton. It provides a simple and declarative way to define your pipelines in your Git repository and have them automatically executed on your Kubernetes cluster. It integrates seamlessly with Git providers like GitHub, GitLab, Bitbucket, and Forgejo, and provides feedback directly on your pull requests and commits.
1414

1515
## Why Pipelines-as-Code?
1616

@@ -54,15 +54,15 @@ Before getting started with Pipelines-as-Code, ensure you have:
5454
- **Git Provider**: One of:
5555
- GitHub (GitHub App or Webhook)
5656
- GitLab (Webhook)
57-
- Gitea/Forgejo (Webhook)
57+
- Forgejo (Webhook) - Tech Preview
5858
- Bitbucket Cloud/Data Center (Webhook)
5959
- **CLI Tool**: `kubectl` for cluster access
6060
- **Optional**: `tkn` CLI for Tekton operations
6161

6262
## Key Features
6363

6464
- **Git-based workflow**: Define your Tekton pipelines in your Git repository and have them automatically triggered on Git events like push, pull request, and comments.
65-
- **Multi-provider support**: Works with GitHub (via GitHub App & Webhook), GitLab, Gitea, Bitbucket Data Center & Cloud via webhooks.
65+
- **Multi-provider support**: Works with GitHub (via GitHub App & Webhook), GitLab, Forgejo (Tech Preview), Bitbucket Data Center & Cloud via webhooks.
6666
- **Annotation-driven workflows**: Target specific events, branches, or CEL expressions and gate untrusted PRs with `/ok-to-test` and `OWNERS`; see [Running the PipelineRun](https://pipelinesascode.com/docs/guide/running/).
6767
- **ChatOps style control**: `/test`, `/retest`, `/cancel`, and branch or tag selectors let you rerun or stop PipelineRuns from PR comments or commit messages; see [GitOps Commands](https://pipelinesascode.com/docs/guide/gitops_commands/).
6868
- **Skip CI support**: Use `[skip ci]`, `[ci skip]`, `[skip tkn]`, or `[tkn skip]` in commit messages to skip automatic PipelineRun execution for documentation updates or minor changes; GitOps commands can still override and trigger runs manually; see [Skip CI Commands](https://pipelinesascode.com/docs/guide/gitops_commands/#skip-ci-commands).

docs/content/docs/dev/_index.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,55 +40,54 @@ If you need to redeploy just Pipelines as Code, you can use ko directly:
4040
env KO_DOCKER_REPO=localhost:5000 ko apply -f config -B
4141
```
4242

43-
## Gitea
43+
## Forgejo
4444

45-
Gitea is "unofficially" supported. You just need to configure Gitea the same way
46-
you do for other webhook methods with a token.
45+
Forgejo is supported as a Tech Preview provider. See the [Forgejo installation guide](/docs/install/forgejo) for setup instructions.
4746

48-
Here is an example of a Gitea NS/CRD/Secret (set to empty):
47+
Here is an example of a Forgejo NS/CRD/Secret configuration:
4948

5049
```yaml
5150
---
5251
apiVersion: v1
5352
kind: Namespace
5453
metadata:
55-
name: gitea
54+
name: forgejo
5655

5756
---
5857
apiVersion: "pipelinesascode.tekton.dev/v1alpha1"
5958
kind: Repository
6059
metadata:
61-
name: gitea
62-
namespace: gitea
60+
name: forgejo
61+
namespace: forgejo
6362
spec:
64-
url: "https://gitea.my.com/owner/repo"
63+
url: "https://forgejo.example.com/owner/repo"
6564
git_provider:
66-
user: "git"
67-
url: "Your gitea installation URL, i.e: https://gitea.my.com/"
65+
type: "gitea" # Use "gitea" - Forgejo is API-compatible with Gitea
66+
url: "https://forgejo.example.com/"
6867
secret:
69-
name: "secret"
68+
name: "forgejo-secret"
7069
key: token
7170
webhook_secret:
72-
name: "secret"
71+
name: "forgejo-secret"
7372
key: "webhook"
7473
---
7574
apiVersion: v1
7675
kind: Secret
7776
metadata:
78-
name: gitea-home-chmouel
79-
namespace: gitea
77+
name: forgejo-secret
78+
namespace: forgejo
8079
type: Opaque
8180
stringData:
82-
token: "your token has generated in gitea"
83-
webhook: "" # make sure it's empty when you set this up on the interface and here
81+
token: "your token generated in Forgejo"
82+
webhook: "" # Forgejo allows empty webhook secrets
8483
```
8584
8685
There are some gotchas with the webhook validation secret. Pipelines-as-Code
87-
detects a Gitea install and lets the user set an empty webhook secret (by default
86+
detects a Forgejo install and lets the user set an empty webhook secret (by default
8887
it's enforced).
8988
90-
startpaac will by default spin up a new instance of Forgejo (a Gitea fork) to play
91-
with and run the Gitea E2E tests.
89+
startpaac will by default spin up a new instance of Forgejo to play
90+
with and run the Forgejo E2E tests.
9291
9392
You will need to create a Hook URL generated from <https://hook.pipelinesascode.com/new>
9493
into the environment variable `TEST_GITEA_SMEEURL`.
@@ -104,7 +103,7 @@ The E2E tests will automatically create a repo using the admin username for each
104103
## Debugging E2E
105104

106105
As long as you have the secrets set up, you should be able to run the e2e tests properly.
107-
Gitea is the easiest to run (since they are self-contained). For the rest,
106+
Forgejo is the easiest to run (since they are self-contained). For the rest,
108107
you will need to set up some environment variables.
109108

110109
See the [e2e on kind
@@ -268,10 +267,10 @@ This shortcode creates a red warning blockquote indicating that a feature is in
268267
#### support_matrix
269268

270269
```markdown
271-
{ {< support_matrix github_app="true" github_webhook="true|false" gitea="true|false" gitlab="true|false" bitbucket_cloud="true|false" bitbucket_datacenter="true|false" >}}
270+
{ {< support_matrix github_app="true" github_webhook="true|false" forgejo="true|false" gitlab="true|false" bitbucket_cloud="true|false" bitbucket_datacenter="true|false" >}}
272271
```
273272

274-
This shortcode generates a compatibility table showing which Git providers support a particular feature. Each parameter accepts "true" or "false" values, displaying checkmarks (✅) or cross marks (❌) accordingly. The table lists all major Git providers (GitHub App, GitHub Webhook, Gitea, GitLab, Bitbucket Cloud, and Bitbucket Data Center) with their support status for the feature.
273+
This shortcode generates a compatibility table showing which Git providers support a particular feature. Each parameter accepts "true" or "false" values, displaying checkmarks (✅) or cross marks (❌) accordingly. The table lists all major Git providers (GitHub App, GitHub Webhook, Forgejo, GitLab, Bitbucket Cloud, and Bitbucket Data Center) with their support status for the feature.
275274

276275
## Documentation when we are doing the Release Process
277276

docs/content/docs/guide/gitops_commands.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Similar to `/retest`, the `/ok-to-test` command will only trigger new PipelineRu
4242
### Requiring a SHA with `/ok-to-test`
4343

4444
{{< tech_preview "Requiring a SHA argument to `/ok-to-test`" >}}
45-
{{< support_matrix github_app="true" github_webhook="false" gitea="false" gitlab="false" bitbucket_cloud="false" bitbucket_datacenter="false" >}}
45+
{{< support_matrix github_app="true" github_webhook="false" forgejo="false" gitlab="false" bitbucket_cloud="false" bitbucket_datacenter="false" >}}
4646

4747
Cluster administrators can enforce SHA validation on `/ok-to-test` by setting
4848
`require-ok-to-test-sha: "true"` in the Pipelines-as-Code ConfigMap. This
@@ -90,7 +90,7 @@ Please be aware that GitOps commands such as `/test` and others will not functio
9090

9191
## GitOps Commands on Pushed Commits
9292

93-
{{< support_matrix github_app="true" github_webhook="true" gitea="false" gitlab="true" bitbucket_cloud="false" bitbucket_server="false" >}}
93+
{{< support_matrix github_app="true" github_webhook="true" forgejo="false" gitlab="true" bitbucket_cloud="false" bitbucket_server="false" >}}
9494

9595
If you want to trigger a GitOps command on a pushed commit, you can include the `GitOps` comments within your commit messages. These comments can be used to restart either all pipelines or specific ones. Here's how it works:
9696

@@ -168,7 +168,7 @@ The PipelineRun will be restarted regardless of the annotations if the comment `
168168

169169
### Triggering PipelineRun on Git tags
170170

171-
{{< support_matrix github_app="true" github_webhook="true" gitea="false" gitlab="true" bitbucket_cloud="false" bitbucket_server="false" >}}
171+
{{< support_matrix github_app="true" github_webhook="true" forgejo="false" gitlab="true" bitbucket_cloud="false" bitbucket_server="false" >}}
172172

173173
You can retrigger a PipelineRun against a specific Git tag by commenting on
174174
the tagged commit using a GitOps command. Pipelines-as-Code will resolve the

docs/content/docs/guide/matchingevents.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ files.
189189
## Matching a PipelineRun on a Regex in a comment
190190

191191
{{< tech_preview "Matching PipelineRun on regex in comments" >}}
192-
{{< support_matrix github_app="true" github_webhook="true" gitea="true" gitlab="true" bitbucket_cloud="false" bitbucket_datacenter="false" >}}
192+
{{< support_matrix github_app="true" github_webhook="true" forgejo="true" gitlab="true" bitbucket_cloud="false" bitbucket_datacenter="false" >}}
193193

194194
You can trigger a PipelineRun based on a comment on a Pull Request or a [Pushed
195195
Commit]({{< relref
@@ -239,7 +239,7 @@ relref "/docs/guide/gitops_commands.md#gitops-commands-on-pushed-commits" >}}).
239239
## Matching PipelineRun to a Pull Request labels
240240

241241
{{< tech_preview "Matching PipelineRun to a Pull-Request label" >}}
242-
{{< support_matrix github_app="true" github_webhook="true" gitea="true" gitlab="true" bitbucket_cloud="false" bitbucket_datacenter="false" >}}
242+
{{< support_matrix github_app="true" github_webhook="true" forgejo="true" gitlab="true" bitbucket_cloud="false" bitbucket_datacenter="false" >}}
243243

244244
Using the annotation `pipelinesascode.tekton.dev/on-label`, you can match a
245245
PipelineRun to a Pull Request label. For example, if you want to match the
@@ -261,7 +261,7 @@ metadata:
261261
targeted branch.
262262
* The `on-event` is still needed to match the Pull Request event on the
263263
proper targeted event.
264-
* This annotation is currently supported only on GitHub, Gitea, and GitLab
264+
* This annotation is currently supported only on GitHub, Forgejo, and GitLab
265265
providers. Bitbucket Cloud and Bitbucket Data Center do not support adding labels
266266
to Pull Requests.
267267
* When you add a label to a Pull Request, the corresponding PipelineRun is

docs/content/docs/guide/policy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ weight: 50
77

88
Pipelines-as-Code uses policies to control which actions can be performed by
99
users who belong to specific teams within an organization, as defined on GitHub
10-
or other supported Git providers (currently GitHub and Gitea).
10+
or other supported Git providers (currently GitHub and Forgejo).
1111

12-
{{< support_matrix github_app="true" github_webhook="true" gitea="true" gitlab="false" bitbucket_cloud="false" bitbucket_datacenter="false" >}}
12+
{{< support_matrix github_app="true" github_webhook="true" forgejo="true" gitlab="false" bitbucket_cloud="false" bitbucket_datacenter="false" >}}
1313

1414
## Supported Actions
1515

docs/content/docs/guide/running.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ the pull request describing the error. The error will also be logged in the user
128128
Despite validation errors, Pipelines-as-Code continues to run other correctly parsed and matched PipelineRuns.
129129
However, if a PipelineRun has YAML syntax error, it halts the execution of all PipelineRuns, even those that are syntactically correct.
130130

131-
{{< support_matrix github_app="true" github_webhook="true" gitea="true" gitlab="true" bitbucket_cloud="false" bitbucket_server="false" >}}
131+
{{< support_matrix github_app="true" github_webhook="true" forgejo="true" gitlab="true" bitbucket_cloud="false" bitbucket_server="false" >}}
132132

133133
When an event is triggered from a Pull Request, a new comment will be created on
134134
the Pull Request detailing the error.
@@ -147,7 +147,7 @@ Here is an example of a YAML error being reported as a comment to a Pull Request
147147
### Cancelling in-progress PipelineRuns
148148

149149
{{< tech_preview "Cancelling in progress PipelineRuns" >}}
150-
{{< support_matrix github_app="true" github_webhook="true" gitea="true" gitlab="true" bitbucket_cloud="true" bitbucket_datacenter="false" >}}
150+
{{< support_matrix github_app="true" github_webhook="true" forgejo="true" gitlab="true" bitbucket_cloud="true" bitbucket_datacenter="false" >}}
151151

152152
You can choose to cancel a PipelineRun that is currently in progress. This can
153153
be done by adding the annotation `pipelinesascode.tekton.dev/cancel-in-progress:

docs/content/docs/install/bitbucket_cloud.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Bitbucket Cloud
3-
weight: 14
3+
weight: 15
44
---
55
# Use Pipelines-as-Code with Bitbucket Cloud
66

docs/content/docs/install/bitbucket_datacenter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Bitbucket Data Center
3-
weight: 15
3+
weight: 16
44
---
55
# Install Pipelines-as-Code on Bitbucket Data Center
66

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
---
2+
title: Forgejo
3+
weight: 14
4+
---
5+
6+
{{< tech_preview "Forgejo" >}}
7+
8+
# Use Pipelines-as-Code with Forgejo Webhook
9+
10+
Pipelines-as-Code supports [Forgejo](https://forgejo.org) through a webhook.
11+
12+
Forgejo is a community-driven Git forge that originated as a fork of Gitea. Pipelines-as-Code originally supported Gitea and now supports Forgejo, maintaining API compatibility between the two platforms. Both use the same provider type (`gitea`) in Pipelines-as-Code configuration.
13+
14+
Follow the Pipelines-as-Code [installation](/docs/install/installation) according to your Kubernetes cluster.
15+
16+
## Create Forgejo Personal Access Token
17+
18+
Create a Forgejo token for Pipelines-as-Code by going to the Applications tab
19+
of the user settings, or to this URL (replace the domain name with your domain
20+
name).
21+
22+
<https://your.forgejo.domain/user/settings/applications>
23+
24+
When creating the token, select these scopes:
25+
26+
### Required Scopes
27+
28+
These scopes are necessary for basic Pipelines-as-Code functionality:
29+
30+
- **Repository** (Write) - For setting commit status and reading repository contents
31+
- **Issue** (Write) - For creating and editing comments on pull requests
32+
33+
### Optional Scopes
34+
35+
- **Organization** (Read) - Only required if using [team-based policies]({{< relref "/docs/guide/policy" >}}) to restrict pipeline triggers based on Forgejo organization team membership
36+
37+
{{< hint info >}}
38+
For most users, only the **Required Scopes** are needed. Skip Organization (Read) unless you plan to use `policy.team_ids` in your Repository CRD configuration.
39+
{{< /hint >}}
40+
41+
Keep the generated token noted somewhere, or otherwise you will have to recreate it.
42+
43+
## Create a `Repository` and configure webhook
44+
45+
{{< hint info >}}
46+
The `tkn pac create repo` and `tkn pac webhook` commands do not currently support Forgejo. You must configure the webhook manually.
47+
{{< /hint >}}
48+
49+
### Configure webhook manually
50+
51+
1. From your Forgejo repository, go to **Settings** -> **Webhooks** and click **Add Webhook** -> **Forgejo**.
52+
53+
2. Set the **HTTP method** to **POST** and **POST content type** to **application/json**.
54+
55+
3. Set the **Target URL** to the Pipelines-as-Code controller public URL. On OpenShift, you can get the public URL like this:
56+
57+
```shell
58+
echo https://$(oc get route -n pipelines-as-code pipelines-as-code-controller -o jsonpath='{.spec.host}')
59+
```
60+
61+
_If you are not using OpenShift you will need to get the public route from your ingress controller._
62+
63+
4. Set a **Secret** or generate a random one with:
64+
65+
```shell
66+
head -c 30 /dev/random | base64
67+
```
68+
69+
5. Select the following **Trigger On** events under **Custom events...** (these map to the events Pipelines-as-Code processes):
70+
71+
**Repository events:**
72+
- Push
73+
74+
**Pull request events:**
75+
- Opened
76+
- Reopened
77+
- Synchronized
78+
- Label updated
79+
- Closed
80+
81+
**Issue events:**
82+
- Comments (only comments on open pull requests are processed)
83+
84+
6. Click **Add Webhook**.
85+
86+
### Create the Secret
87+
88+
Create a secret with the personal token and webhook secret in your target namespace:
89+
90+
```shell
91+
kubectl -n target-namespace create secret generic forgejo-webhook-config \
92+
--from-literal provider.token="TOKEN_AS_GENERATED_PREVIOUSLY" \
93+
--from-literal webhook.secret="SECRET_AS_SET_IN_WEBHOOK_CONFIGURATION"
94+
```
95+
96+
If you configured an empty webhook secret, use an empty string:
97+
98+
```shell
99+
kubectl -n target-namespace create secret generic forgejo-webhook-config \
100+
--from-literal provider.token="TOKEN_AS_GENERATED_PREVIOUSLY" \
101+
--from-literal webhook.secret=""
102+
```
103+
104+
### Create the Repository CRD
105+
106+
Create a [`Repository CRD`](/docs/guide/repositorycrd) with the secret field referencing it:
107+
108+
```yaml
109+
---
110+
apiVersion: "pipelinesascode.tekton.dev/v1alpha1"
111+
kind: Repository
112+
metadata:
113+
name: my-repo
114+
namespace: target-namespace
115+
spec:
116+
url: "https://forgejo.example.com/owner/repo"
117+
git_provider:
118+
# Use "gitea" as the type - Forgejo is API-compatible with Gitea
119+
type: "gitea"
120+
# Set this to your Forgejo instance URL
121+
url: "https://forgejo.example.com"
122+
secret:
123+
name: "forgejo-webhook-config"
124+
# Set this if you have a different key in your secret
125+
# key: "provider.token"
126+
webhook_secret:
127+
name: "forgejo-webhook-config"
128+
# Set this if you have a different key in your secret
129+
# key: "webhook.secret"
130+
```
131+
132+
## Notes
133+
134+
- **Provider Type**: Use `type: "gitea"` in your Repository CRD. Forgejo is a fork of Gitea and maintains full API compatibility.
135+
136+
- **Forgejo Instance URL**: You must specify `git_provider.url` pointing to your Forgejo instance URL.
137+
138+
- **Webhook Secret**: Pipelines-as-Code currently does not validate webhook signatures for Forgejo/Gitea. Secrets can be stored, but requests are accepted without signature verification.
139+
140+
- The `git_provider.secret` key cannot reference a secret in another namespace. Pipelines-as-Code always assumes it will be in the same namespace where the `Repository` has been created.
141+
142+
## Update Token
143+
144+
When you have regenerated a new token, you must update it in the cluster. You can find the secret name in the `Repository` CR:
145+
146+
```yaml
147+
spec:
148+
git_provider:
149+
secret:
150+
name: "forgejo-webhook-config"
151+
```
152+
153+
Update the secret:
154+
155+
```shell
156+
kubectl -n target_namespace patch secret forgejo-webhook-config -p "{\"data\": {\"provider.token\": \"$(echo -n $NEW_TOKEN|base64 -w0)\"}}"
157+
```

docs/content/docs/install/global_repositories_setting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ means a repository configured using [GitHub webhooks]({{< relref "/docs/install/
100100

101101
- github
102102
- gitlab
103-
- gitea
103+
- gitea (used as well for Forgejo)
104104
- bitbucket-cloud
105105
- bitbucket-datacenter
106106

0 commit comments

Comments
 (0)