| To enable Jenkins to checkout our Git projects from Gitlab, the "Deploy Key" of Jenkins currently must be enabled for each project in Gitlab individually.This is a tedious task that can be automated using the Gitlab API. A practical example:
- In Gitlab, go to "Admin Area" -> "Deploy Keys" and add a new key that we will call "jenkins-gitlab".
- If Jenkins should be able to checkout the source code of the project named "MyProject", we must enable the deploy key for this project. For this, I currently have to go to the Settings of the Gitlab-Project manually ("Settings" -> "Repository" -> "Deploy Keys") to enable the Deploy Key called "jenkins-gitlab").
Using the gitlab-branch-source-plugin, this is the only thing I currently still have to do manually for each new gitlab project. Fortunately, this could be automated using the Gitlab API. Please have a look at the section "Enable a deploy key": https://docs.gitlab.com/ee/api/deploy_keys.html#enable-a-deploy-key If would be really great if I could configure a "Deploy Token title" at organization-folder level in Gitlab (or maybe even as a system setting) that "gitlab-branch-source-plugin" uses to automatically call the Gitlab API to enable the deploy config for the gitlab projects. |