Anuj Balan
Anuj Balan

Reputation: 7729

Save all Jenkins jobs to a repository

I have 15 Jenkins jobs configured in order to implement a specific flow. I am improving and editing these jobs as time goes by.

Is there a way to save all these jobs and its configurations to a repository or at least in the form of export jobs, save it and import when needed?

Upvotes: 1

Views: 2771

Answers (4)

Larry Shatzer
Larry Shatzer

Reputation: 3627

There are two plugins that will help you save Jenkins jobs, "SCM Sync configuration" and "JobConfigHistory" defined at the wiki.jenkins-ci.org website.

SCM Sync Configuration Plugin (which keeps the config in a SCM repository)

or

Job Config History Plugin (Saves copies of all job and system configurations)

Upvotes: 3

Jesse Glick
Jesse Glick

Reputation: 25461

The Workflow feature may let you write your entire process as one (Groovy) script, which you can then maintain in your version control system alongside other sources.

Upvotes: 0

daspilker
daspilker

Reputation: 8194

The Job DSL Plugin allows to define the jobs in a DSL and store the DSL scripts in a SCM repo. The DSL increases the readability of the config files in contrast to the XML format.

For an intro, see the slides and video from the Configuration as Code: The Job DSL Plugin talk at the Jenkins User Conference 2015 in London.

Upvotes: 2

Ondřej Šotek
Ondřej Šotek

Reputation: 1812

You can move/copy jobs to another destination simply by copying directory with job (default path for jobs directories is /var/lib/jenkins/jobs).

You can get more info here - https://wiki.jenkins-ci.org/display/JENKINS/Administering+Jenkins

Upvotes: 0

Related Questions