Filters out for the scope of the block, the environment variables proposed by Jenkins except the ones listed.
These are available to any external processes spawned within that scope.
For example:
node {
env.CUSTOM=test
env.INFO=useful
keepEnv(['INFO']) {
// at this point the CUSTOM will not be available
bat 'echo %INFO%'
}
}
See the documentation for the env singleton for more information on environment variables.