You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
831 B
25 lines
831 B
5 years ago
|
#!/usr/bin/env groovy
|
||
|
import hudson.tools.InstallSourceProperty
|
||
|
import jenkins.model.Jenkins
|
||
|
import jenkins.plugins.nodejs.tools.NodeJSInstallation
|
||
|
import jenkins.plugins.nodejs.tools.NodeJSInstaller
|
||
|
import static jenkins.plugins.nodejs.tools.NodeJSInstaller.DEFAULT_NPM_PACKAGES_REFRESH_HOURS
|
||
|
|
||
|
final versions = [
|
||
|
'NodeJS 13.x': '13.10.1'
|
||
|
]
|
||
|
|
||
|
final globalPackages = "eslint@~6.8.0"
|
||
|
|
||
|
Jenkins.instance.getDescriptor(NodeJSInstallation).with {
|
||
|
installations = versions.collect {
|
||
|
new NodeJSInstallation(it.key, null, [
|
||
|
new InstallSourceProperty([
|
||
|
new NodeJSInstaller(
|
||
|
it.value,
|
||
|
globalPackages,
|
||
|
DEFAULT_NPM_PACKAGES_REFRESH_HOURS)
|
||
|
])
|
||
|
])
|
||
|
} as NodeJSInstallation[]
|
||
|
}
|