use of jenkins.plugins.nodejs.configfiles.NPMConfig in project nodejs-plugin by jenkinsci.
the class NodeJSBuildWrapperTest method createSetting.
private Config createSetting(String id, String content, List<NPMRegistry> registries) {
String providerId = new NPMConfigProvider().getProviderId();
Config config = new NPMConfig(id, null, null, content, providerId, registries);
GlobalConfigFiles globalConfigFiles = j.jenkins.getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
globalConfigFiles.save(config);
return config;
}
use of jenkins.plugins.nodejs.configfiles.NPMConfig in project nodejs-plugin by jenkinsci.
the class NodeJSCommandInterpreterTest method createSetting.
private Config createSetting(String id, String content, List<NPMRegistry> registries) {
String providerId = new NPMConfigProvider().getProviderId();
Config config = new NPMConfig(id, null, null, content, providerId, registries);
GlobalConfigFiles globalConfigFiles = j.jenkins.getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
globalConfigFiles.save(config);
return config;
}
use of jenkins.plugins.nodejs.configfiles.NPMConfig in project nodejs-plugin by jenkinsci.
the class NodeJSDescriptorUtils method getConfigs.
/**
* Get all NPMConfig defined for the given context.
*
* @param context the context where lookup the config files
* @return a collection of user npmrc files found for the given context
* always including a system default.
*/
@Nonnull
public static ListBoxModel getConfigs(@Nullable ItemGroup<?> context) {
ListBoxModel items = new ListBoxModel();
items.add(Messages.NPMConfig_default(), "");
for (Config config : ConfigFiles.getConfigsInContext(context, NPMConfigProvider.class)) {
items.add(config.name, config.id);
}
return items;
}
use of jenkins.plugins.nodejs.configfiles.NPMConfig in project nodejs-plugin by jenkinsci.
the class NpmrcFileSupplyTest method createSetting.
private Config createSetting(String id, String content, List<NPMRegistry> registries) {
String providerId = new NPMConfigProvider().getProviderId();
Config config = new NPMConfig(id, null, null, content, providerId, registries);
GlobalConfigFiles globalConfigFiles = j.jenkins.getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
globalConfigFiles.save(config);
return config;
}
Aggregations