Code Monkey home page Code Monkey logo

ez-templates-plugin's Introduction

Build Status

Allows you to use any job as a template for other jobs.

Using EZ-Templates

Creating a template

Any Jenkins job can be used as a template

  • Select Allow this job to be used as a template

A template can be a runnable job in its own right or be disabled and used only as a parent for "real" jobs. Image of template configuration

❗ WARNING: Templates have the capacity to magnify a bad decision so should never be used without an automated backup solution in place. ThinBackup plugin is a good candidate for this.

Using a template

Existing jobs

Any Jenkins job can inherit from a template of the same job type.

  • Select Use another job as a template and enter the template's name
  • Click Apply. When you open the job after this, you will see the configuration copied in from the template.

Image of implmentation configuration

❗ The same job type (e.g. Maven/Freestyle) is important.

New jobs

Choose New Item > Copy existing item and enter the template's name. The new job will be automatically created as an implementation.

Customising the implementation

Synchronisation happens whenever an implementation job or its template is saved. The implementation overwrites its config with that of the template, discarding any local changes.

Only configured items (see Advanced section) are retained.

❗ External edits are not monitored, users must manually Configure>Save after changing the raw config.xml.

Job Parameters

One of those is the Parameters section.

  • New parameters added to the template are added to the implementation
  • Old parameters not in the template are removed from the implementation
    • ❗ Renaming a template parameter counts as a removal and addition - it is not synched as a "rename" and you will lose any customisation.
  • Existing parameters are synchronised
    • The parameters' Default Values are retained by the implementation.
    • ❗ You cannot delete choices from a choice parameter, this would require a full remove/add of the property to reset the implementations.

Usecases

Not everything can be parameterised in a Jenkins job config. Here's a few sample uses

  • SCM Repository URL can be a param, allowing completely different projects to be built with the same template
    • Alternatively the param could simply the Git branch (e.g. master, feature)
  • Combined with NodeLabel plugin, implementations can specify build node requirements
    • e.g. Only build on Linux or boxes with IPv6
  • Parameterized Trigger and Conditional BuildStep plugins are the basis of many flexible configurations based on job parameters

ez-templates-plugin's People

Contributors

aritzbastida avatar brantone avatar didster avatar drekbour avatar ff-ahumberston avatar jbarmash avatar joelj avatar juanpablo-santos avatar notmyfault avatar olivergondza avatar walterbrebels avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.