JoelJ/ez-templates — pull request #37 by aritzbastida (2014-11-21 09:42:45+00:00)
Title: Support for template variables (Proof of Concept)

This pull requests implements support for template variables:

**Template:**
![template](https://cloud.githubusercontent.com/assets/2572295/5127510/f4c07ec8-70d4-11e4-9aab-817ad54a6993.png)

**Implementation:**
![implementation](https://cloud.githubusercontent.com/assets/2572295/5127514/fcab7138-70d4-11e4-8018-8099f6f78574.png)

*Disclaimer:* This solution shouldn't be considered as "definite", but just as a Proof Of Concept.

**Description:** This solution replaces variables marked with the *#{VARIABLE}* syntax in the template to their corresponding value defined in each of the implementations. Note that the syntax is very similar to that of parameters, but using a hash instead of a dollar symbol.

This solution adds up to and is compatible with job parameters. In fact, both can be used at the same time, each with different purposes:
* Template variables are "static", in that they get their values resolved at design-time, when we save the configuration of the template or implementation.
* Job parameters are "dynamic", and resolved at execution-time, when a user launches the job manually and specifies the values.

Before this PR, ez-template only catered for job parameters, which has several drawbacks for static (design-time) variables:
* The build contract is changed: "Build now" changes to "Build with Parameters". Some plugins may have issues with parameterized builds (e.g. [build-pipeline-plugin](https://issues.jenkins-ci.org/browse/JENKINS-25427))
* Static variables (URL repository, email recipient list for notifications, etc.) and dynamic variables (the server we want to deploy on) are mixed up.
* Static variables can be changed by the user!! (even if he has no configuration privileges)
* Some plugins do not support or have issues with job parameters (e.g. [subversion-plugin](https://issues.jenkins-ci.org/browse/JENKINS-22568))