Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IF statement in Jenkins windows boolean parameter

On Jenkins installed on windows 7, I choose :

This build is parameterized

Add a Boolean parameter named WIN7

Then in Windows batch command I want to do something if WIN7 parameter is selected.

How boolean are converted? I tried the following but no success

IF %WIN7%=="true" (

)

Also :

echo %WIN7% 

is printing true

like image 388
arsenik Avatar asked Feb 12 '23 13:02

arsenik


1 Answers

IF "%WIN7%"=="true" (
...
)

Quotes are also part of the compared string.And are required when there is a space within the compared values.

like image 176
npocmaka Avatar answered Feb 15 '23 11:02

npocmaka