Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Jenkins plugin to copy a job in a build step.
Java

This branch is 14 commits ahead of ikedam:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
.gitignore
README.md
README_ja.md
pom.xml

README.md

Job Copy Builder plugin

Japanese version of this document is README_ja.md

Jenkins plugin to copy a job in a build step.

What's this?

Job Copy Builder is a Jenkins plugin. This plugin provides Copy Job build step:

  • It makes a new job from an existing job.
    • This can be configured as a build step, so you can copy multiple jobs in one build execution with multiple build steps.
  • You specify following parameters.
    • From Job Name
      • Variable expressions can be used.
    • To Job Name
      • Variable expressions can be used.
    • Overwite
      • Specifies whether to overwrite if the destination job already exists.
  • Additional operations will be performed when copying.
    • Enable Job: Enabling the destination job if the source job is disabled.
    • Replace String: Replace strings in a job configuration.
      • Source and destination strings can contain variable expressions.
  • Additional operation can be extended by using the Jenkins extention point featere.

Limitations

  • The job contains Copy Job build steps must run on the master node.

How does this work?

This plugin works as following:

  1. Reads the configuration xml (config.xml) of the copying job.
  2. Applies the operations to the configuration xml string.
  3. Create a new job with the processed configuration xml string.

Extension point

New additional operations can be added with extending JobcopyOperation, overriding the following method:

public abstract String JobcopyOperation::perform(String xmlString, String encoding, EnvVars env, PrintStream logger);

Or, you can use AbstractXmlJobcopyOperation, which provides you a parsed XML Document node, overriding the following method:

public abstract String AbstractXmlJobcopyOperation::perform(Document doc, EnvVars env, PrintStream logger);

TODO

  • Add new operation that replaces strings with regular expressions.
Something went wrong with that request. Please try again.