Search in sources :

Example 1 with PluginDescriptor

use of com.thoughtworks.go.plugin.api.info.PluginDescriptor in project gocd by gocd.

the class AuthorizationViewModelBuilder method allPluginInfos.

@Override
public List<PluginInfo> allPluginInfos() {
    List<PluginInfo> pluginInfos = new ArrayList<>();
    for (PluginDescriptor descriptor : metadataStore.getPlugins()) {
        Image icon = metadataStore.getIcon(descriptor);
        pluginInfos.add(new PluginInfo(descriptor, AuthorizationPluginConstants.EXTENSION_NAME, null, null, icon));
    }
    return pluginInfos;
}
Also used : PluginDescriptor(com.thoughtworks.go.plugin.api.info.PluginDescriptor) ArrayList(java.util.ArrayList) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo) Image(com.thoughtworks.go.plugin.access.common.models.Image)

Example 2 with PluginDescriptor

use of com.thoughtworks.go.plugin.api.info.PluginDescriptor in project gocd by gocd.

the class ElasticAgentViewViewModelBuilder method allPluginInfos.

@Override
public List<PluginInfo> allPluginInfos() {
    List<PluginInfo> pluginInfos = new ArrayList<>();
    for (PluginDescriptor descriptor : metadataStore.getPlugins()) {
        Image icon = metadataStore.getIcon(descriptor);
        pluginInfos.add(new PluginInfo(descriptor, ElasticAgentPluginConstants.EXTENSION_NAME, null, null, icon));
    }
    return pluginInfos;
}
Also used : PluginDescriptor(com.thoughtworks.go.plugin.api.info.PluginDescriptor) ArrayList(java.util.ArrayList) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo) Image(com.thoughtworks.go.plugin.access.common.models.Image)

Example 3 with PluginDescriptor

use of com.thoughtworks.go.plugin.api.info.PluginDescriptor in project gocd by gocd.

the class ElasticAgentViewViewModelBuilder method pluginInfoFor.

@Override
public PluginInfo pluginInfoFor(String pluginId) {
    PluginDescriptor descriptor = metadataStore.find(pluginId);
    if (descriptor == null) {
        return null;
    }
    Image icon = metadataStore.getIcon(descriptor);
    ArrayList<PluginConfiguration> pluginConfigurations = PluginConfiguration.getPluginConfigurations(metadataStore.getProfileMetadata(descriptor));
    PluginView pluginView = new PluginView(metadataStore.getProfileView(descriptor));
    PluggableInstanceSettings settings = new PluggableInstanceSettings(pluginConfigurations, pluginView);
    return new PluginInfo(descriptor, ElasticAgentPluginConstants.EXTENSION_NAME, null, settings, icon);
}
Also used : PluginDescriptor(com.thoughtworks.go.plugin.api.info.PluginDescriptor) PluggableInstanceSettings(com.thoughtworks.go.server.ui.plugins.PluggableInstanceSettings) PluginConfiguration(com.thoughtworks.go.server.ui.plugins.PluginConfiguration) PluginView(com.thoughtworks.go.server.ui.plugins.PluginView) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo) Image(com.thoughtworks.go.plugin.access.common.models.Image)

Example 4 with PluginDescriptor

use of com.thoughtworks.go.plugin.api.info.PluginDescriptor in project gocd by gocd.

the class CombinedPluginInfoTest method shouldGetDescriptorOfPluginUsingAnyPluginInfo.

@Test
public void shouldGetDescriptorOfPluginUsingAnyPluginInfo() throws Exception {
    PluginDescriptor descriptor = mock(PluginDescriptor.class);
    NotificationPluginInfo notificationPluginInfo = new NotificationPluginInfo(descriptor, null);
    PluggableTaskPluginInfo pluggableTaskPluginInfo = new PluggableTaskPluginInfo(descriptor, null, null);
    CombinedPluginInfo pluginInfo = new CombinedPluginInfo(asList(pluggableTaskPluginInfo, notificationPluginInfo));
    assertThat(pluginInfo.getDescriptor(), is(descriptor));
}
Also used : PluginDescriptor(com.thoughtworks.go.plugin.api.info.PluginDescriptor) NotificationPluginInfo(com.thoughtworks.go.plugin.domain.notification.NotificationPluginInfo) PluggableTaskPluginInfo(com.thoughtworks.go.plugin.domain.pluggabletask.PluggableTaskPluginInfo) Test(org.junit.jupiter.api.Test)

Example 5 with PluginDescriptor

use of com.thoughtworks.go.plugin.api.info.PluginDescriptor in project gocd by gocd.

the class GoConfigServiceIntegrationTest method setupMetadataForPlugin.

private void setupMetadataForPlugin() {
    PluginDescriptor pluginDescriptor = GoPluginDescriptor.builder().id("cd.go.artifact.docker.registry").build();
    PluginConfiguration buildFile = new PluginConfiguration("BuildFile", new Metadata(false, false));
    PluginConfiguration image = new PluginConfiguration("Image", new Metadata(false, true));
    PluginConfiguration tag = new PluginConfiguration("Tag", new Metadata(false, false));
    PluginConfiguration fetchProperty = new PluginConfiguration("FetchProperty", new Metadata(false, true));
    PluginConfiguration fetchTag = new PluginConfiguration("Tag", new Metadata(false, false));
    PluginConfiguration registryUrl = new PluginConfiguration("RegistryURL", new Metadata(true, false));
    PluginConfiguration username = new PluginConfiguration("Username", new Metadata(false, false));
    PluginConfiguration password = new PluginConfiguration("Password", new Metadata(false, true));
    PluggableInstanceSettings storeConfigSettings = new PluggableInstanceSettings(asList(registryUrl, username, password));
    PluggableInstanceSettings publishArtifactSettings = new PluggableInstanceSettings(asList(buildFile, image, tag));
    PluggableInstanceSettings fetchArtifactSettings = new PluggableInstanceSettings(asList(fetchProperty, fetchTag));
    ArtifactPluginInfo artifactPluginInfo = new ArtifactPluginInfo(pluginDescriptor, storeConfigSettings, publishArtifactSettings, fetchArtifactSettings, null, new Capabilities());
    ArtifactMetadataStore.instance().setPluginInfo(artifactPluginInfo);
}
Also used : GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor) PluginDescriptor(com.thoughtworks.go.plugin.api.info.PluginDescriptor) PluggableInstanceSettings(com.thoughtworks.go.plugin.domain.common.PluggableInstanceSettings) Capabilities(com.thoughtworks.go.plugin.domain.artifact.Capabilities) Metadata(com.thoughtworks.go.plugin.domain.common.Metadata) PluginConfiguration(com.thoughtworks.go.plugin.domain.common.PluginConfiguration) ArtifactPluginInfo(com.thoughtworks.go.plugin.domain.artifact.ArtifactPluginInfo)

Aggregations

PluginDescriptor (com.thoughtworks.go.plugin.api.info.PluginDescriptor)28 Metadata (com.thoughtworks.go.plugin.domain.common.Metadata)11 PluggableInstanceSettings (com.thoughtworks.go.plugin.domain.common.PluggableInstanceSettings)11 PluginConfiguration (com.thoughtworks.go.plugin.domain.common.PluginConfiguration)11 ArtifactPluginInfo (com.thoughtworks.go.plugin.domain.artifact.ArtifactPluginInfo)10 Capabilities (com.thoughtworks.go.plugin.domain.artifact.Capabilities)8 GoPluginDescriptor (com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)7 Image (com.thoughtworks.go.plugin.access.common.models.Image)6 AuthorizationPluginInfo (com.thoughtworks.go.plugin.domain.authorization.AuthorizationPluginInfo)5 PluggableInstanceSettings (com.thoughtworks.go.server.ui.plugins.PluggableInstanceSettings)4 PluginConfiguration (com.thoughtworks.go.server.ui.plugins.PluginConfiguration)4 PluginInfo (com.thoughtworks.go.server.ui.plugins.PluginInfo)4 PluginView (com.thoughtworks.go.server.ui.plugins.PluginView)4 ArrayList (java.util.ArrayList)4 BeforeEach (org.junit.jupiter.api.BeforeEach)4 Test (org.junit.jupiter.api.Test)4 Capabilities (com.thoughtworks.go.plugin.domain.authorization.Capabilities)2 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)1 ClusterProfile (com.thoughtworks.go.config.elastic.ClusterProfile)1 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)1