Pass Jenkins build parameters to pipeline nodes
问题 I created a new Jenkins pipeline. The pipeline is (currently) parametrized with a single boolean option named VAR_A . My pipeline script is: node ('windows') { echo "$VAR_A" bat 'env' } When I manually build the project with VAR_A checked, "true" is echoed, as expected. The list of environment variables, however, does not show VAR_A=true . I am able to get env to show VAR_A if I wrap the call in a withEnv block: node ('windows') { echo "$VAR_A" withEnv(["VAR_A=$VAR_A"]) { bat 'env' } } I will