Integrate with GitLab

44 views
Skip to first unread message

Sverre Moe

unread,
Mar 6, 2021, 3:41:20 PM3/6/21
to Jenkins Users
What is the preferred way to Integrate both Jenkins and GitLab?
What is the best way to do it?

GitLab has deploy keys. I have created deploy keys for all 30 Jenkins build agents.
I have added these deploy keys to each project. We only got 8 projects migrated from Gitolite at the moment. Adding all the deploy keys to 400+ projects is not a good way.

The GitLab Jenkins Integration documentation mentions creating a Jenkins user in GitLab.
Then that user could be added to each groups as Guest or Reporter.
Since we use GitLab Enterprise Edition, such a user would count towards the license.

With Gitolite we have configured to call the following URL for each repository on git push

I could manually create Webhooks in GitLab for each project triggering this URL, but that would a big feat, considering we have about 400+ repositories.

I have installed in Jenkins LTS. 2.263.1 these plugins:
GitLab (This plugin is not maintained)
GitLab Branch Source

In GitLab Project Settings > Integration Settings > Jenkins CI
Is there a better way to integrate Jenkins with GitLab, considering this plugin is no longer being maintained.

I would think the best way is to use the GitLab Branch Source plugin. Adding a GitLab group, then all projects in that group will be added to Jenkins. In theory (I have not tried it).

Sverre Moe

unread,
Mar 16, 2021, 2:32:59 PM3/16/21
to Jenkins Users
Is it possible to combine both GitLab Plugin with GitLab Branch Source Group?

The Group Project will notify GitLab when builds succeeds or fails, but it just shows if the entire pipeline is success or failed.

We would like to show something like Travis shows in GitHub
Compile success
Test failed
Analysis pending

I do not know if this is possible with the GitLab API.

I tried running the GitLab Plugin steps, within a GitLab Group Merge Request build.
It did nothing. No information on GitLab MR when I sent
updateGitlabCommitStatus

Sverre Moe

unread,
Mar 16, 2021, 3:06:10 PM3/16/21
to Jenkins Users
Shame.
With GitLab Plugin, on a Multibranch Pipeline Project.
I get to see all the stages that has succeeded and failed on the GitLab Merge Request.

When I click on the Stages Icon, when using GitLab Plugin it shows me all the stages.
When using GitLab Group all it shows is "jenkinsci/mr-head".

Is there any way to get the same with GitLab Group?
The updateGitlabCommitStatus run within a Jenkinsfile on a GitLab Group Project does not make its way into GitLab.
Reply all
Reply to author
Forward
0 new messages