Webhooks between Gitea and Jenkins

Hello! I have just started using both Gitea and Jenkins on a local Kubernetes node, but I have some problems with webhooks.

My current status is:

  • I have created a Gitea org in Jenkins, which is correctly seeing the various repositories, including the only one that has a Jenkinsfile; if I manually start builds on that repository, it works correctly
  • I have manually created a webhook in Gitea, which seems to be working since each request (whenever I commit to master) correctly sends a request and receives the answer “Processed” by Jenkins.

The problem is that nothing happens on Jenkins: there is no build being created at all. I have checked the various URLs (both in Jenkins config and in the webhook) to be sure that I was not using locahost or the wrong port, and so far it seems this is not the case. Am I missing some steps?
I can access the configuration for org/repository/master in Jenkins, the one with “Build triggers”, but everything is greyed out and I cannot select anything from there, so I cannot try stuff like “Poll SCM” (which I don’t know if it should be needed).

Thank you for your help!

2 Likes

I have the exact same problem as you describe. Perhaps the plugin is outdated.

Hey … i have the same problem … any solution?? :-/

thx in advance

Have you tried to use https://github.com/jenkinsci/gitea-plugin ?

1 Like

Yes I tried it :frowning: Does not work … in gitea I tested the webhook and the response is “processed” … In jenkins no build was automated triggered. :frowning: In Jenkins I can start a build manually.
There are no log entries visible so I have no idea where the problem comes from.

I solved the problem :slight_smile:

This was the solution for me:

The URL in the webhook has to be the same like the ‘ROOT_URL’ entry in the app.ini of the gitea configuration file. I used in this entry not the ip address but the machine name.

2 Likes

Hi, could you give me the details on how you solved it? I still didn’t understand by "the same like the ROOT_URL ". Currently, my gitea and docker are running on separate docker containers but are on the same network. Jenkins can access my gitea repos and gitea successfully sends request to the webhook and gets a 200 response with Processed.
My gitea webhook is set to “http://<Ip of the container>/gitea-webhook/post”. I also tried setting it to “http://<ContainerName>/gitea-webhook/post”. Both of these webhook urls get a 200 response but does not trigger build in my jenkins.