I disagree that this has been "totally supported by implementation of JENKINS-40364". As I understand (and experience) it, this request is for a GLOBAL specification per NPM configuration. While JENKSINS-40364 does give you a way to muddle through this, it is particularly painful when you're dealing with multi-project declarative pipeline scripts (Jenkinsfile). In that situation, unless I'm mistaken, you have to wrap and redeclare the configuration you want to use over and over for every stage in the pipeline script. This is very clunky and not in the spirit of what a "Global" configuration would achieve. With a global configuration, you would set it up once, associated with the node version configuration, and then simply use it via something in your Jenkinsfile declared one time like:
tools {
nodejs 'NodeJS-LTS'
}
Where "NODEJS-LTS" was the name of a configuration node instance. If this ticket were implemented, that one declaration would also carry in the associated .npmrc configuration and apply it across the entire script instead of having to do this:
stages {
stage('Setup') {
nodejs(nodeJSInstallationName: 'NodeJS-LTS', configId: 'internal-artifact-repo') {
}
}
stage('Build') {
nodejs(nodeJSInstallationName: 'NodeJS-LTS', configId: 'internal-artifact-repo') {
}
}
stage('Publish') {
nodejs(nodeJSInstallationName: 'NodeJS-LTS', configId: 'internal-artifact-repo') {
}
}
}
They're quite different when you try to actually use them. This is especially true if you're managing a large group of developers across multiple projects all working with a single internal NPM repository. If there's a way to do this at a GLOBAL level right now, someone please let me know how.
For portable and secure configuration the config-file-plugin could be useful