Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins job generator

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.

like image 890
nlu Avatar asked Sep 19 '13 12:09

nlu


2 Answers

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
like image 59
syl20bnr Avatar answered Oct 11 '22 11:10

syl20bnr


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.

like image 27
Larry Cai Avatar answered Oct 11 '22 11:10

Larry Cai