GithubHelp home page GithubHelp logo

jlleitschuh / jenkinsci__jobcopy-builder-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jenkinsci/jobcopy-builder-plugin

0.0 2.0 0.0 210 KB

Jenkins plugin to copy a job in a build step.

Java 98.69% HTML 1.31%

jenkinsci__jobcopy-builder-plugin's Introduction

Jobcopy Builder plugin

This plugin adds "Copy Job" as a build step.You can select how to retrieve choices, including the way to share choices among all jobs.

What’s this?

This plugin provides a Copy Job build step:

  • It makes a new job from an existing job.

    • You can copy multiple jobs in one build execution with specifying multiple Copy Job build steps.

    • Can be applied to any type of jobs.

  • You specify following parameters.

    • From Job Name

      • Variable expressions can be used.

    • To Job Name

      • Variable expressions can be used.

    • Overwrite

      • Specifies whether to overwrite the destination job if it already exists.

  • Additional operations can be performed when copying.

    • Enable Job: Enabling the destination job if the source job is disabled.

    • Disable Job: Disabling the destination job if the source job is enabled. ( >= 1.3.0)

    • Replace String: Replace strings in a job configuration.

      • Source and destination strings can contain variable expressions.

  • Additional operation can be extended by using Extension Points.

Screenshots

  1. You can add "Copy Job" build step.
    image

  2. "Copy Job" performs additional operations. Replacing strings in the configuration, enabling a disabled job.

    • The job copied from
      image

    • The job copied to. String "VERSION" is replaced, and the job is enabled.
      image

  3. Replacing strings can be applied to any part of configurations, including that of plugins. This is a example that the branch field of Git plugin is replaced.

    • The job copied from.
      image

    • The job copied to. String "VERSION" is replaced.
      image

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

A new way to provide choices can be added with implementing JobcopyOperation, overriding the following method:

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

or, with extending AbstractXmlJobcopyOperation, overriding the following method:

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

Used with promoted builds

When used with Promoted Builds Plugin, the configurations of promotions are not copied for they are not stored in config.xml.
Do as followings:

  • Click "Advanced" in "copy Job"

  • Add "Additional File Sets", specify "promotions/*/config.xml" in "Files".

Permissions to copy jobs

  • "Copy Job" build step requires following permissions.

    Target Job Required permissions Notes

    Item to copy from

    Job/Read, Job/ExtendedRead

    Job/ExtendedRead is displayed only when you install Extended Read Permission Plugin. You can grant it by granting Job/Configure instead.

    Item to copy to (when create)

    Job/Create

     

    Item to copy to (when overwrite)

    Job/Read, Job/Configure

     

  • "Copy Job" defaults to run as ANONYMOUS.

Issues

To report a bug or request an enhancement to this plugin please create a ticket in JIRA (you need to login or to sign up for an account). Also have a look on How to report an issue

jenkinsci__jobcopy-builder-plugin's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.