It should work, but doesn't!
I define my environment variable in Manage Jenkins->System Configuration,
Global Properties, Environment variables. I use the variable in other jobs
so I know the variable definition works!
Thanks.
On Thursday, November 8, 2018 at 12:45:18 PM UTC-5, Cuong Tran wrote:
>
> Where do you define your "environment variable"?
>
> It should work as ${BRANCH_TO_BUILD} if you define BRANCH_TO_BUILD under
> global environment variables, folder, inside your pipeline, etc.
>
>
> On Thursday, November 8, 2018 at 8:56:38 AM UTC-8, ZillaYT wrote:
>>
>> Someone suggested using ${env.branchToBuild}, so I tried env.branchToBuild,
>> $env.branchToBuild, ${env.branchToBuild}, and "${env.branchToBuild}" all
>> to NO avail.
>>
>> On Thursday, November 8, 2018 at 10:26:34 AM UTC-5, ZillaYT wrote:
>>>
>>> I have a Jenkins Pipeline job which uses "Pipeline script from SCM" as
>>> my pipeline. One of this block's parameters is "Branch to build" of course.
>>> How can I used an environment variable for the text block? I tried, for
>>> example , $branchToBuild, ${branchToBuild} or "${branchToBuild}" and
>>> it just takes those as literal values and does not extrapolate the string.
>>> I do have that variable defined and use it in other jobs.
>>>
>>> Is it just not possible to do this?
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/1bea1dd6-9c66-4117-81b5-31bd55b8134d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.