I have spent days now trying different approaches to get Jenkins trigger when we accept a Merge Request. Unfortunately, I can't get anything to work on our system. I have tried different plugins from Jenkins side of things to trigger GitLab, but they seem not to work either. Adding parameterized strings and adding token to end of URL's, I have tried them all - maybe not in correct order, I'm not sure.
I would like a nice configuration to tell me exactly what settings I have to setup and which plugins to use. I have uploaded most plugins for webhooks and merge request plugins, but none of them really work.
Then, next question is how do I debug what is coming from GitLab over to Jenkins? Do you look at system logs? There seem to be a lot of stuff there, and the same with /var/log/Jenkins/jenkins.log file.
Any help/suggestions is very much appreciated.
GitLab version: 7.12.2 Jenkins version: 1.620
I know this is an old question, but here's my setup for doing this on GitLab CE 8.13.12 and Jenkins 2.46.2 using declarative pipelines, and the Gitlab plugin 1.4.5 and Gitlab Hook plugin 1.4.2. These steps will likely work with the latest version as well.
Then, the pipeline scripts look like this MR
master
This gives me two jobs. The MR job depends on the GitLab plugin to define what source and target repos and branches to checkout, merge, and build. The master job will only build the master repo.
The last step is to configure the webhooks in GitLab for the repo. When you make a webhook in GitLab, it asks for the following info:
And you should be done!