0
votes

I am trying to trigger jenkins pipeline on gitlab push to branch and tag. Using Jenkins ver. 2.176.2 and gitlab version 10.7.3-ee. Although I have supposedly set up the webhooks properly, I do not see the jenkins job being triggered.

I have installed the gitlab plugin for jenkins, and configured the gitlab server, including the Personal Access Token for GitLab APIs access generated in gitlab. I have defined the webhook (currently requesting trigger on all events). (for testing, ssl verification is off). When testing the webhook in gitlab, I consistently receive HTTP error 500. In jenkins pipeline job, I have selected "build when change is pushed to gitlab. gitlab webhook..." - this is the URL I used when defining the webhook in gitlab, under "integrations" section.

When pushing to gitlab, I see no event listed under "integrations -> recent deliveries", I see no log under jenkins logs "com.dabsquared.gitlabjenkins" logger (set to log level "FINEST". And lastly, the pipeline job is not triggered as I expected.

Any leads will be very helpful.

Adding printscreen of the Jenkins configuration of the gitlab for reference to the comment I added on possibility this is issue with the personal access token Jenkins gitlab server configuration

1

1 Answers

0
votes

Go to Settings of Gitlab Project -> Integrations and type in the Jenkins Job project url in 'URL'. URL should take either form:

http://JENKINS_URL/project/PROJECT_NAME

http://JENKINS_URL/project/FOLDER/PROJECT_NAME

Notice that the url does not contain "job" within it and instead uses "project".

Make sure under Triggers, you have "Push Events" checked as well if you want the job to trigger whenever someone pushes a commit.

Finally, run a build against your Jenkinsfile first before testing the webhook so Jenkins will pick-up the trigger settings for Gitlab.

Please refer the link for more details.