/global-variable-string-parameter-plugin

Jenkins plugin to provide a string variable that substitutes global variables using the ${} syntax

Primary LanguageJava

Global Variable String Parameter Plugin

This plugin is intended to provide a parameter with support for global node properties via $VARIABLE or ${VARIABLE}

Installation

Add global-variable-string-parameter.hpi to jenkins/plugins and restart. In your job, choose Add Parameter and select Global Variable String Parameter. Use $VARIABLE or ${VARIABLE} to substitute global node parameters.

Example

  1. Create a global variable
    createglobalvariable
  2. Create a global variable string parameter in a job
    createparameter
  3. Reference the global variable in the default value
    parametervalue
  4. Add a simple echo statement to demonstrate the substitution
    echoparameter
  5. The variable remains unsubstituted on the Build Now page
    parameterbuildnow
  6. But is correctly substituted in the console output
    console
  7. The variable can also be changed from the build now screen to be incorrect
    buildnow2
  8. And no longer substitutes
    console2