eerriicc
eerriicc

Reputation: 1240

Is there a way to specify several Jenkins files for the pipeline?

At the moment, we are generating Jenkins jobs using the Job DSL plugin. Typically, we have the following jobs per project:

Am I right that there can be only one Jenkins file in the project's repository? How could I map our requirements to the new Jenkins pipeline?

I'm asking because we're going to install version 2 of Jenkins, and I'm not sure whether we should abandon our Jenkins job generation and use Jenkins files.

Upvotes: 1

Views: 857

Answers (1)

StephenKing
StephenKing

Reputation: 37630

There are a couple of options, which might help you to migrate over to Jenkins pipelines. But you don't have to, especially not all at once.

  • You can use a shared library to define functions that can be used in multiple jobs, e.g. a buildOurThing function.
  • You can trigger an existing job (of whatever kind) using the build step. So you could model your new pipeline around existing jobs.
  • You can still use parameterized builds, if you want to use the deployment job with different targets.

Jenkins pipeline is really worth using, but maybe don't force you to an immediate switch. If JobDSL works for you, keep it. If you have new jobs (pipelines) to create, get familiar with pipelines.

Upvotes: 1

Related Questions