integrating-jenkins-and-gitea

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 min)

 

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 dojocube 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 dojocube:

new-gitea-organization

 

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

add-folder-credential-provider

 

 

Last, enter owner as dojocube 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:

http://192.168.100.51:30080/gitea-webhook/post?job=dojocube

jenkins-gitea-webhook

 

First, save the Webhook:

jenkins-gitea-webhook-saved

 

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

 

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

 

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!