Plugin Information |
---|
View Global Variable String Parameter on the plugin site for more information. |
Global Variable String Parameter Plugin
Provides a parameter with support for global node properties via $VARIABLE or ${VARIABLE}
Utilization
After installing, in your job choose Add Parameter and select Global Variable String Parameter. Use $VARIABLE or ${VARIABLE} in either the default value or on the build now page to substitute global node parameters.
Version History
Version 1.2 (Sept 17 2013)
- Fix race condition where concurrent builds could cause variables not to substitute
Version 1.1 (Nov 02 2012)
- Initial Release
Example
- Create a global variable
- Create a global variable string parameter in a job
- Reference the global variable in the default value
- Add a simple echo statement to demonstrate the substitution
- The variable remains unsubstituted on the Build Now page
- But is correctly substituted in the console output
- The variable can also be changed from the build now screen to be incorrect
- And no longer substitutes
5 Comments
Unknown User (gbois)
This feature should be into Jenkins core (improvement of the String parameter) instead of providing a new plugin.
In my opinion, there are too many plugins and providing this kind of feature by a new plugin contributes to decrease Jenkins stability.
Unknown User (pmaccamp)
Ya I agree or perhaps have global properties available in a Run's variable list. Substituting a variable into another variable is a little hacky.
Unknown User (nurasna)
Hi,
I used above Plugin but get error as "Global Variable GLOBAL_VARS does not exist". I follow instructions as above but got above error. As well I try the variables in '/env-vars.html', like 'BUILD_NUMBER'. It also given the above error. May I missed some instruction and let me know what should I do to correct the above.
Thank you very much in advance.
Anura
Unknown User (pmaccamp)
The plugin will only substitute global variables defined in the global properties section in https://your-jenkins/configure. The variable you want to substitute must be of the form
or
inside the value field of the global variable string parameter.
All of those variables are already exposed to your build, you don't need to use this plugin to access them.
Unknown User (veenone)
Hi,
is it possible to have the description field to accept HTML string just like Jenkin's String parameter ?
Sorry for bringing this up after 4 years without updates