ℹ️ Gitea plugin depends on the
multibranch pipeline
plugin.
- Go to Manage Jenkins -> Configure System and scroll down to Gitea Servers
- Add a new server by name and URL, your URL field should be an accessible location of your Gitea instance via HTTP(s)
- Optionally enable the "manage hooks" checkbox, this will allow Jenkins to configure your webhooks using an account of your choosing.
- It is recommended to use a personal access token, you can do this by selecting "Add" next to the credentials dropdown and changing it's "Kind" to Gitea Personal Access Token and "Scope" to System.
ℹ️ Hint: you can ignore a "HTTP 403/Forbidden" error here in case your Gitea instance is private.
- login to your Gitea instance with an administrator account (optional, you can also register a new user).
- create a new user, e.g. "jenkins". Set password to something secure - you will not need it for login.
- add the jenkins user to the organization you want to build projects for in jenkins (either by adding him to an existing team or adding a new "ci"-team). Make sure that team is associated to the repositories you want to build.
- log out of Gitea.
- log back in as the new "jenkins" user.
- in user profile settings, go to "application" and add a new access token. Make sure to note the token shown.
ℹ️ Hint: As of Gitea version 1.16.9 the user requires Write permissions to repository code. Otherwise, status checks cannot be submitted anymore causing "HTTP 403/Forbidden" errors during builds.
- In main menu, click "New Item"
Using branch-api
plugin version <2.7.0
- Select "Gitea organization" as the item type
Using branch-api
plugin version >=2.7.0
- Select "Organization Folder" as the item type
- When configuring the new item, select "Repository Sources"
ℹ️ This is only necessary when using branch-api
plugin version >=2.7.0
- In the "Gitea organzations" section, add a new credential of type "Gitea personal access token".
- Add the access token created before for the jenkins user in Gitea. Ignore the error about the token not having the correct length.
- In the "Owner" field, add the name of the organization in Gitea you want to build projects for (not the full name).
- Fill the rest of the form as required. Click "Save". The following scan should list the repositories that the jenkins user can see in the organization selected.