0

I have a Gitea and a Jenkins server. I installed Gitea plugin in Jenkins and set-up a multibranch pipeline which itself adds a webhook to the gitea repo. That works great, but the Jenkins pipeline will not build if a new tag was added. I wanted to add another webhook to do so.

As far as I can tell there is a webhook event for creation of branches and tags.

Is there a way to get the payload of the webhook in a Jenkinsfile to find out if there was a new tag added?

Apollo
  • 1,296
  • 2
  • 11
  • 24

1 Answers1

1

The Jenkins GitLab plugin makes the webhook payload information available in the Jenkins Global Variable env, which you can print (see How to list all `env` properties within jenkins pipeline job?)

Maybe this Gitea plugin does the same ... have you tried to print all env variables?

Atxulo
  • 466
  • 3
  • 7
  • That was a good idea but there is not information in env. But the webhook works so Ill just use git describe and trigger the latest tag, that should work for us. Thank you. – Apollo Jan 31 '23 at 10:15
  • I ended up adding a second job in Jekins which I trigger with a Gitea webhook on tag creation. In the Jenkinsfile I use git describe to get the most recent tag and run build job: "multi/${tag}". – Apollo Feb 01 '23 at 07:00