Jenkins job generator

不问归期 提交于 2019-12-07 03:56:27

问题


On a project Im working on we have a pretty advanced command-line interface to build, test, package and deploy software.

Now we want to use jenkins as a front-end to this CLI and we want to be able to generate job configurations. We want the interface simple, the user only supply a couple of parameters and jenkins will then query our CLI and generate the needed build steps.

Simple use case:

  1. Create new domain-specific-job
  2. Select Product
    • Jenkins now queries the CLI and updates the next drop-down with the products different brances.
  3. Select branch
  4. Jenkins generates the build steps by querying the build steps

As Im new to plugin development in Jenkins (and jenkins overall) I would love to get some tips and pointers to where to start.


回答1:


There are several plugins to generate jobs in Jenkins, there is also the Jenkins CLI.

I think the better approach would be to use the Jenkins CLI to generate Jobs from the outside by developing a cool GUI tool integrating both CLIs nicely. Here is an example: http://tikalk.com/alm/using-jenkins-cli-job-gen

If you really require to do it in the Jenkins front-end then here are some pointers on possible plugins:

  • job DSL plugin https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin
  • jobcopy builder plugin https://wiki.jenkins-ci.org/display/JENKINS/Jobcopy+Builder+plugin
  • job generator plugin https://wiki.jenkins-ci.org/display/JENKINS/Job+Generator+Plugin



回答2:


Take a look at jenkins-job-builder from jenkins, it could help you to abstract your work and use command line to create the jenkins jobs.



来源:https://stackoverflow.com/questions/18895169/jenkins-job-generator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!