Oliver Williams
Oliver Williams

Reputation: 6334

export all Jenkins data to a CSV format

I am new to Jenkins but learning for the purpose of seeing what our jobs do (there are so many that nobody has a handle on it right now).

I would like to export all the Jenkins data as a CSV where each row is a Jenkins job and each column represents a field in the configuration form for that job. Is this possible?

P.S. I have found threads on exporting and importing between Jenkins servers but not this particular method, which is more for analysis.

Upvotes: 1

Views: 5043

Answers (1)

Martin
Martin

Reputation: 4030

I don't know about CVS but you can export all jobs into an XML containing all its configuration using the command line tool.

http://jenkins-server/cli lists all the commands of the jenkins-cli tool. Download jenkins-cli.jar locally to use. Be sure you have the proper credentials. Overall/Read account permission is required.

In order to retrieve all the jobs' configurations, first retrieve the list of all jobs with the following:

java -jar jenkins-cli.jar -s http://jenkins-server list-jobs

Then, to obtain the complete data of each job, do:

java -jar jenkins-cli.jar -s http://jenkins-server get-job JOB1 > JOB1.xml

For more information on jenkins-cli tool, see this.

Upvotes: 1

Related Questions