简体   繁体   中英

Is there any documentation on how to configure a GitLab Group in Jenkins with Job DSL?

I'm trying to configure a GitLab Group using the GitLab Branch Source plugin. In the UI, there are explanations for what the different options do, but for Job DSL, I'm really struggling to find any documentation on what the different options are. The worst part is trying to figure out which number is the correct strategyId .

So far it seems like my only option is trial and error until the job produced by the Job DSL matches the job I would have configured using the UI.

For reference, what I want to configure is pipelines for all open MRs building the source branch merged into the target branch. I also don't want pipelines for all branches, but only master and branches named with a certain pattern. I'm also happy to accept answers on how to do exactly that, but preferably with a link to relevant docs.

It seems like the answer is that the UI is the best documentation. Your Jenkins instance will also have some documentation available at https://your.jenkins.installation/plugin/job-dsl/api-viewer/index.html .

The way I figured it out was by mapping the UI options to the APIs in the above documentation. That documentation is unfortunately very limited, but if you understand which option in the UI it corresponds to, you can use the question mark in the UI to get more info on how it is used.

Figuring out what strategyId to use wasn't as difficult as I thought. It's directly mapped to the options in the UI; 1 is the first option, 2 is the second, etc.

It would be great if the Job DSL API documentation could incorporate the info from the UI. That would have made the experience a lot better.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM