keepEnv: Keep only specified environment variables
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:
// 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.
A list of environment variables to retain. Specify one variable name per line. All other environment variables added to the Pipeline by Jenkins will be removed from the block. System-contributed environment variables like
PATH will be reset to their default value.
- Type: Array / List of