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);
}
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);
}
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);
}
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);
}
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);
}
}
Aggregations