We use the
Config File Provider plugin and the
Pipeline Utilities Steps plugin in conjunction with folders to get around the JENKINS-42906 gap, in a Scripted Pipeline context.
This is actually nicer IMHO than the hidden env variables functionality, because you can use various flavors of configuration files, use an editor that understands your flavor(s) of choice, and then paste back into the UI.
In our case we're just using simple Java properties files something like the following.
def props
node() {
configFileProvider( [ configFile( fileId: 'your-folder-cfg-file-id', variable: 'WHATEVER', replaceTokens: true ) ] ) {
props = readProperties( file: WHATEVER )
}
}
//now go do stuff with the props Map, even massaging for consumption by withEnv() ...
The ony downside is, I suppose, is the hacky nature of having the properties written down to the agent's workspace just to read them right back again and discard the file.
Brian