Search in sources :

Example 16 with PluginDescriptor

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

the class AuthorizationPluginInfoBuilder method pluginInfoFor.

@Override
public AuthorizationPluginInfo pluginInfoFor(String pluginId) {
    PluginDescriptor descriptor = store.find(pluginId);
    if (descriptor == null) {
        return null;
    }
    Image icon = store.getIcon(descriptor);
    ArrayList<PluginConfiguration> pluginConfigurations = PluginConfiguration.getPluginConfigurations(store.getProfileMetadata(descriptor));
    PluginView profileView = new PluginView(store.getProfileView(descriptor));
    PluggableInstanceSettings profileSettings = new PluggableInstanceSettings(pluginConfigurations, profileView);
    ArrayList<PluginConfiguration> roleConfigurations = PluginConfiguration.getPluginConfigurations(store.getRoleMetadata(descriptor));
    PluginView roleView = new PluginView(store.getRoleView(descriptor));
    PluggableInstanceSettings roleSettings = new PluggableInstanceSettings(roleConfigurations, roleView);
    return new AuthorizationPluginInfo(descriptor, profileSettings, roleSettings, icon);
}
Also used : PluginDescriptor(com.thoughtworks.go.plugin.api.info.PluginDescriptor) PluggableInstanceSettings(com.thoughtworks.go.server.ui.plugins.PluggableInstanceSettings) AuthorizationPluginInfo(com.thoughtworks.go.server.ui.plugins.AuthorizationPluginInfo) PluginConfiguration(com.thoughtworks.go.server.ui.plugins.PluginConfiguration) PluginView(com.thoughtworks.go.server.ui.plugins.PluginView) Image(com.thoughtworks.go.plugin.access.common.models.Image)

Example 17 with PluginDescriptor

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

the class AuthorizationViewModelBuilder 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 profileView = new PluginView(metadataStore.getProfileView(descriptor));
    PluggableInstanceSettings profileSettings = new PluggableInstanceSettings(pluginConfigurations, profileView);
    ArrayList<PluginConfiguration> roleConfigurations = PluginConfiguration.getPluginConfigurations(metadataStore.getRoleMetadata(descriptor));
    PluginView roleView = new PluginView(metadataStore.getRoleView(descriptor));
    PluggableInstanceSettings roleSettings = new PluggableInstanceSettings(roleConfigurations, roleView);
    return new PluginInfo(descriptor, AuthorizationPluginConstants.EXTENSION_NAME, null, profileSettings, roleSettings, 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 18 with PluginDescriptor

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

the class ElasticAgentPluginInfoBuilder method pluginInfoFor.

@Override
public ElasticPluginInfo pluginInfoFor(String pluginId) {
    PluginDescriptor descriptor = store.find(pluginId);
    if (descriptor == null) {
        return null;
    }
    Image icon = store.getIcon(descriptor);
    ArrayList<PluginConfiguration> pluginConfigurations = PluginConfiguration.getPluginConfigurations(store.getProfileMetadata(descriptor));
    PluginView pluginView = new PluginView(store.getProfileView(descriptor));
    PluggableInstanceSettings settings = new PluggableInstanceSettings(pluginConfigurations, pluginView);
    return new ElasticPluginInfo(descriptor, 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) ElasticPluginInfo(com.thoughtworks.go.server.ui.plugins.ElasticPluginInfo) Image(com.thoughtworks.go.plugin.access.common.models.Image)

Example 19 with PluginDescriptor

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

the class PluggableArtifactConfigTest method setup.

@BeforeEach
public void setup() {
    artifactPluginInfo = mock(ArtifactPluginInfo.class);
    PluginDescriptor pluginDescriptor = mock(PluginDescriptor.class);
    when(artifactPluginInfo.getDescriptor()).thenReturn(pluginDescriptor);
    when(pluginDescriptor.id()).thenReturn("cd.go.s3");
    ArtifactMetadataStore.instance().setPluginInfo(artifactPluginInfo);
}
Also used : PluginDescriptor(com.thoughtworks.go.plugin.api.info.PluginDescriptor) ArtifactPluginInfo(com.thoughtworks.go.plugin.domain.artifact.ArtifactPluginInfo) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 20 with PluginDescriptor

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

the class ElasticAgentPluginRegistry method createAgent.

public void createAgent(final String pluginId, String autoRegisterKey, String environment, Map<String, String> configuration, Map<String, String> clusterProfileConfiguration, JobIdentifier jobIdentifier) {
    PluginDescriptor plugin = findPlugin(pluginId);
    if (plugin != null) {
        LOGGER.debug("Processing create agent for plugin: {} with environment: {} with elastic agent configuration: {} in cluster: {}", pluginId, environment, configuration, clusterProfileConfiguration);
        extension.createAgent(pluginId, autoRegisterKey, environment, configuration, clusterProfileConfiguration, jobIdentifier);
        LOGGER.debug("Done processing create agent for plugin: {} with environment: {} with elastic agent configuration: {} in cluster: {}", pluginId, environment, configuration, clusterProfileConfiguration);
    } else {
        LOGGER.warn("Could not find plugin with id: {}", pluginId);
    }
}
Also used : PluginDescriptor(com.thoughtworks.go.plugin.api.info.PluginDescriptor)

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