Setup Gitea/Forgejo support¶
Note
The following instructions also apply to Forgejo instances.
CodeMC supports hooking into Gitea instances for creating new builds whenever a commit is done to your project.
Setup automatic Builds¶
CodeMC allows you to create builds whenever a commit is pushed to your repository.
Unlike other Sites is the setup for Gitea/Forgejo a little more complicated and requires some steps on the CI first.
- Login to your account on
https://ci.codemc.io
if you haven't already. - Click your username on the top-right.
- Click Security on the left-hand side.
- Under API Token press Add new Token, give the token a proper name and press Generate.
- Copy the token.
- Encode the token alongside your Username in the format
{username}:{token}
using a Base64 encoder (i.e. base64encode.org). - Copy the generated Base64 code for later.
After completing the above steps, head over to your Gitea/Forgejo repository and follow these steps.
- Press Settings
- Press Webhooks on the left-hand side.
- Press the Add Webhook button and select Gitea ( Forgejo may also work).
- Add
https://ci.codemc.io/job/{username}/job/{project}/build
as the target URL. - Under Trigger on either leave it at
push events
or choseCustom events...
and choose the following:Pull request
Push
- Under Authorization-Header put
Basic {code}
where{code}
is the Base64-encoded text you've created previously. - Press Add Webhook to save your new Webhook.