Hello Team,
Below is my pipeline script in JenkinsFile. I have a variable “hasError” which is initially set to false.
In the below step, I am explicitly setting it to true . Hoowever, during echo, it prints the initialized value and not the set one.
Kindly assist
pipeline
{
agent any
environment
{
hasError = false
}
No, I basically changed the bat step and used a proper assignement to set the env variable hasError
I used a scripted pipeline and not a declarative, that is the reason it looks a bit different. In your declarative you used agent any which is fine as long as you only have windows (controller and agents).