Search in sources :

Example 1 with NPMConfig

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;
}
Also used : NPMConfig(jenkins.plugins.nodejs.configfiles.NPMConfig) NPMConfigProvider(jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider) GlobalConfigFiles(org.jenkinsci.plugins.configfiles.GlobalConfigFiles) Config(org.jenkinsci.lib.configprovider.model.Config) NPMConfig(jenkins.plugins.nodejs.configfiles.NPMConfig)

Example 2 with NPMConfig

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;
}
Also used : NPMConfig(jenkins.plugins.nodejs.configfiles.NPMConfig) NPMConfigProvider(jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider) GlobalConfigFiles(org.jenkinsci.plugins.configfiles.GlobalConfigFiles) Config(org.jenkinsci.lib.configprovider.model.Config) NPMConfig(jenkins.plugins.nodejs.configfiles.NPMConfig)

Example 3 with NPMConfig

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;
}
Also used : NPMConfig(jenkins.plugins.nodejs.configfiles.NPMConfig) Config(org.jenkinsci.lib.configprovider.model.Config) ListBoxModel(hudson.util.ListBoxModel) Nonnull(javax.annotation.Nonnull)

Example 4 with NPMConfig

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;
}
Also used : NPMConfig(jenkins.plugins.nodejs.configfiles.NPMConfig) NPMConfigProvider(jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider) GlobalConfigFiles(org.jenkinsci.plugins.configfiles.GlobalConfigFiles) Config(org.jenkinsci.lib.configprovider.model.Config) NPMConfig(jenkins.plugins.nodejs.configfiles.NPMConfig)

Aggregations

NPMConfig (jenkins.plugins.nodejs.configfiles.NPMConfig)4 Config (org.jenkinsci.lib.configprovider.model.Config)4 NPMConfigProvider (jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider)3 GlobalConfigFiles (org.jenkinsci.plugins.configfiles.GlobalConfigFiles)3 ListBoxModel (hudson.util.ListBoxModel)1 Nonnull (javax.annotation.Nonnull)1