Re: How to use environment variable in Jenkins Pipeline build?

2018-11-08 Thread ZillaYT
I got it answered in stackoverflow How to use environment variables in a Jenkins pipeline job? I just had to uncheck the "Lightweight checkout" box at the bottom of that block, and it

Re: How to use environment variable in Jenkins Pipeline build?

2018-11-08 Thread Mark Waite
That's a good clarification. I believe there is a known bug that the git plugin does not expand variable references in some of the configuration fields. Use a multibranch Pipeline instead, then you can let the Pipeline script expand the variable, and you won't have a confusing mix of changes in

Re: How to use environment variable in Jenkins Pipeline build?

2018-11-08 Thread ZillaYT
Just to be clear, this is the text box in the job configuration page where I want to use an environment variable. [image: Screen Shot 2018-11-08 at 1.37.35 PM.png] On Thursday, November 8, 2018 at 2:19:06 PM UTC-5, ZillaYT wrote: > > It should work, but doesn't! > > I define my environment

Re: How to use environment variable in Jenkins Pipeline build?

2018-11-08 Thread ZillaYT
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

Re: How to use environment variable in Jenkins Pipeline build?

2018-11-08 Thread Cuong Tran
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

How to use environment variable in Jenkins Pipeline build?

2018-11-08 Thread ZillaYT
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