By integrating Jenkins and Gitea with webhook, you have full control over your own self-hosted continuous integration (CI) environment

Integration between Jenkins and Gitea

(Total Setup Time: 8 mins)

Following up with my previous posts, I will integrate Jenkins and Gitea in this guide.

Installing Gitea Plugin on Jenkins

(2 mins)

Navigate to Manage Jenkins > Manage Plugins, click on the Available tab. Search for Gitea, check on it and start installation.

jenkins-gitea-scm-api

Next, restart Jenkins upon installation completes.

jenkins-install-gitea-plugin

Configuring Gitea

(2 mins)

Firstly, following the initial setup , register a new Jenkins user.

jenkins-gitea-account

Secondly, create a new Hello-World repository under seehiong account.

gitea-new-repo

Thirdly, add the newly created Jenkins user as the Collaborator.

gitea-repo-jenkins-collaborator

Configuring Jenkins

(2 mins)

First, navigate to Manage Jenkins > Configure System, enter the following at the Gitea Servers section:

Name: Gitea
Server URL: http://192.168.100.51:30080/
add-gitea-server

Second, select on the Gitea Organization, and enter the item name as seehiong:

gitea-organization

Third, select on the Gitea server and add seehiong (Folder Credentials Provider):

add-folder-credentials-provider

Last, enter owner as seehiong and save configuration:

gitea-organization-config

Jenkins will start the scan and this is the sample result:

scan-gitea-organization-log

Once the Jenkinsfile is added to the repository, my repo appears under the status selection:

jenkins-gitea-hello-world

Configuring and Testing Webhook in Gitea (Optional)

(2 mins)

In this section, I will add Webhook to Jenkins so that it will automatically trigger a build each time we commits to the repo.

add-gitea-webhook

For my setup, the target URL is set as follows:

jenkins-gitea-webhook

First, save the Webhook:

jenkins-gitea-webhook-saved

Second, click on the Test Delivery button to test the connection:

gitea-fake-delivery

Third, after a while you will see that the Test Deliver is success:

gitea-success-delivery

Finally, I complete the setup for integrating Jenkins and Gitea. In the next post , I will describe on the CI workflow for our Spring Boot application. Stay tuned!