Selvaraj M A
Selvaraj M A

Reputation: 3136

Jenkins remote access api

I have configured a build in Jenkins. It contains git scm details, custom shell commands to build project and the Junit report location details.

But Now I want to create jobs with all the configuration items mentioned above dynamically using remote access API. But it looks like there is no documentation on what are all the parameters available to pass to the server for job creation. Where can I find it?

Upvotes: 1

Views: 1703

Answers (2)

Larry Cai
Larry Cai

Reputation: 60143

There are at least two ways to do this.

  1. Jenkins plugins, you can install Job Generator Plugin to create jobs based on your template/workflow
  2. Using Remote Access API to download the config.xml from your base job and use scripts to generate new config.xml and create jobs based on new config.xml

First one is good for simple job without programming competence, second one is good for complex jobs since it can use extra power from programming like python

Upvotes: 1

gareth_bowles
gareth_bowles

Reputation: 21150

I'd recommend using the Job DSL plugin to create jobs dynamically. It's much easier to use the Groovy-based DSL compared to creating XML configuration files and then posting them to Jenkins via the CLI or REST API.

Upvotes: 1

Related Questions