Search in sources :

Example 1 with PluginRepositoryProperties

use of com.netflix.spinnaker.config.PluginsConfigurationProperties.PluginRepositoryProperties in project kork by spinnaker.

the class Front50PluginsConfiguration method front50FileDownloader.

@Bean
public static Front50FileDownloader front50FileDownloader(Environment environment, PluginOkHttpClientProvider pluginsOkHttpClientProvider, Map<String, PluginRepositoryProperties> pluginRepositoriesConfig) {
    PluginRepositoryProperties front50RepositoryProps = pluginRepositoriesConfig.get(PluginsConfigurationProperties.FRONT5O_REPOSITORY);
    URL front50Url = getFront50Url(environment, front50RepositoryProps);
    return new Front50FileDownloader(pluginsOkHttpClientProvider.getOkHttpClient(), front50Url);
}
Also used : PluginRepositoryProperties(com.netflix.spinnaker.config.PluginsConfigurationProperties.PluginRepositoryProperties) Front50FileDownloader(com.netflix.spinnaker.kork.plugins.update.downloader.Front50FileDownloader) URL(java.net.URL) Bean(org.springframework.context.annotation.Bean)

Example 2 with PluginRepositoryProperties

use of com.netflix.spinnaker.config.PluginsConfigurationProperties.PluginRepositoryProperties in project kork by spinnaker.

the class Front50PluginsConfiguration method pluginFront50UpdateRepository.

@Bean
public static UpdateRepository pluginFront50UpdateRepository(Front50Service front50Service, Environment environment, Map<String, PluginRepositoryProperties> pluginRepositoriesConfig, FileDownloaderProvider fileDownloaderProvider) {
    PluginRepositoryProperties front50RepositoryProps = pluginRepositoriesConfig.get(PluginsConfigurationProperties.FRONT5O_REPOSITORY);
    URL front50Url = getFront50Url(environment, front50RepositoryProps);
    return new Front50UpdateRepository(PluginsConfigurationProperties.FRONT5O_REPOSITORY, front50Url, fileDownloaderProvider.get(front50RepositoryProps.fileDownloader), new CompoundVerifier(), front50Service);
}
Also used : CompoundVerifier(org.pf4j.update.verifier.CompoundVerifier) Front50UpdateRepository(com.netflix.spinnaker.kork.plugins.update.repository.Front50UpdateRepository) PluginRepositoryProperties(com.netflix.spinnaker.config.PluginsConfigurationProperties.PluginRepositoryProperties) URL(java.net.URL) Bean(org.springframework.context.annotation.Bean)

Example 3 with PluginRepositoryProperties

use of com.netflix.spinnaker.config.PluginsConfigurationProperties.PluginRepositoryProperties in project kork by spinnaker.

the class Front50PluginsConfiguration method pluginFront50Service.

@Bean
public static Front50Service pluginFront50Service(Environment environment, PluginOkHttpClientProvider pluginsOkHttpClientProvider, Map<String, PluginRepositoryProperties> pluginRepositoriesConfig) {
    PluginRepositoryProperties front50RepositoryProps = pluginRepositoriesConfig.get(PluginsConfigurationProperties.FRONT5O_REPOSITORY);
    URL front50Url = getFront50Url(environment, front50RepositoryProps);
    KotlinModule kotlinModule = new KotlinModule.Builder().build();
    ObjectMapper objectMapper = new ObjectMapper().registerModule(kotlinModule).configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false).configure(SerializationFeature.INDENT_OUTPUT, true).setSerializationInclusion(JsonInclude.Include.NON_NULL);
    return new Retrofit.Builder().addConverterFactory(JacksonConverterFactory.create(objectMapper)).baseUrl(front50Url).client(pluginsOkHttpClientProvider.getOkHttpClient()).build().create(Front50Service.class);
}
Also used : Retrofit(retrofit2.Retrofit) PluginRepositoryProperties(com.netflix.spinnaker.config.PluginsConfigurationProperties.PluginRepositoryProperties) KotlinModule(com.fasterxml.jackson.module.kotlin.KotlinModule) URL(java.net.URL) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Bean(org.springframework.context.annotation.Bean)

Example 4 with PluginRepositoryProperties

use of com.netflix.spinnaker.config.PluginsConfigurationProperties.PluginRepositoryProperties in project kork by spinnaker.

the class PluginsAutoConfiguration method pluginUpdateRepositories.

@Bean
@SneakyThrows
public static List<UpdateRepository> pluginUpdateRepositories(Map<String, PluginRepositoryProperties> pluginRepositoriesConfig, FileDownloaderProvider fileDownloaderProvider, PluginsConfigurationProperties properties) {
    List<UpdateRepository> repositories = pluginRepositoriesConfig.entrySet().stream().filter(entry -> entry.getValue().isEnabled()).filter(entry -> !entry.getKey().equals(PluginsConfigurationProperties.FRONT5O_REPOSITORY)).map(entry -> new ConfigurableUpdateRepository(entry.getKey(), entry.getValue().getUrl(), fileDownloaderProvider.get(entry.getValue().fileDownloader), new CompoundVerifier())).collect(Collectors.toList());
    if (properties.isEnableDefaultRepositories()) {
        log.info("Enabling spinnaker-official and spinnaker-community plugin repositories");
        repositories.add(new ConfigurableUpdateRepository(PluginsConfigurationProperties.SPINNAKER_OFFICIAL_REPOSITORY, new URL("https://raw.githubusercontent.com/spinnaker/plugins/master/official/plugins.json"), fileDownloaderProvider.get(null), new CompoundVerifier()));
        repositories.add(new ConfigurableUpdateRepository(PluginsConfigurationProperties.SPINNAKER_COMMUNITY_REPOSITORY, new URL("https://raw.githubusercontent.com/spinnaker/plugins/master/community/plugins.json"), fileDownloaderProvider.get(null), new CompoundVerifier()));
    }
    if (repositories.isEmpty()) {
        log.warn("No remote repositories defined, will fallback to looking for a " + "'repositories.json' file next to the application executable");
    }
    return repositories;
}
Also used : PluginStatusProvider(org.pf4j.PluginStatusProvider) UpdateRepository(org.pf4j.update.UpdateRepository) SneakyThrows(lombok.SneakyThrows) URL(java.net.URL) SupportingFileDownloader(com.netflix.spinnaker.kork.plugins.update.downloader.SupportingFileDownloader) MetricInvocationAspect(com.netflix.spinnaker.kork.plugins.proxy.aspects.MetricInvocationAspect) LoggerFactory(org.slf4j.LoggerFactory) VersionManager(org.pf4j.VersionManager) PluginBundleExtractor(com.netflix.spinnaker.kork.plugins.bundle.PluginBundleExtractor) InstalledPluginsEndpoint(com.netflix.spinnaker.kork.plugins.actuator.InstalledPluginsEndpoint) PluginInfoReleaseProvider(com.netflix.spinnaker.kork.plugins.update.release.provider.PluginInfoReleaseProvider) ApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) ConfigurableUpdateRepository(com.netflix.spinnaker.kork.plugins.update.repository.ConfigurableUpdateRepository) SpinnakerUpdateManager(com.netflix.spinnaker.kork.plugins.update.SpinnakerUpdateManager) TypeReference(com.fasterxml.jackson.core.type.TypeReference) Path(java.nio.file.Path) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) PreferredPluginInfoReleaseSource(com.netflix.spinnaker.kork.plugins.update.release.source.PreferredPluginInfoReleaseSource) SpringPluginInfoReleaseSource(com.netflix.spinnaker.kork.plugins.update.release.source.SpringPluginInfoReleaseSource) PluginFactory(org.pf4j.PluginFactory) SdkFactory(com.netflix.spinnaker.kork.plugins.sdk.SdkFactory) FRAMEWORK_V2(com.netflix.spinnaker.kork.plugins.PackageKt.FRAMEWORK_V2) FRAMEWORK_V1(com.netflix.spinnaker.kork.plugins.PackageKt.FRAMEWORK_V1) RemotePluginInfoReleaseCache(com.netflix.spinnaker.kork.plugins.update.release.remote.RemotePluginInfoReleaseCache) Collectors(java.util.stream.Collectors) PluginInfoReleaseSource(com.netflix.spinnaker.kork.plugins.update.release.source.PluginInfoReleaseSource) LogInvocationAspect(com.netflix.spinnaker.kork.plugins.proxy.aspects.LogInvocationAspect) LatestPluginInfoReleaseSource(com.netflix.spinnaker.kork.plugins.update.release.source.LatestPluginInfoReleaseSource) Front50PluginInfoReleaseSource(com.netflix.spinnaker.kork.plugins.update.release.source.Front50PluginInfoReleaseSource) InvocationState(com.netflix.spinnaker.kork.plugins.proxy.aspects.InvocationState) Environment(org.springframework.core.env.Environment) Beta(com.netflix.spinnaker.kork.annotations.Beta) java.util(java.util) CompoundVerifier(org.pf4j.update.verifier.CompoundVerifier) InvocationAspect(com.netflix.spinnaker.kork.plugins.proxy.aspects.InvocationAspect) FileDownloaderProvider(com.netflix.spinnaker.kork.plugins.update.downloader.FileDownloaderProvider) ServiceVersion(com.netflix.spinnaker.kork.version.ServiceVersion) SpringPackageVersionResolver(com.netflix.spinnaker.kork.version.SpringPackageVersionResolver) ObjectProvider(org.springframework.beans.factory.ObjectProvider) com.netflix.spinnaker.kork.plugins.config(com.netflix.spinnaker.kork.plugins.config) PluginFrameworkInitializer(com.netflix.spinnaker.kork.plugins.v2.PluginFrameworkInitializer) ConfigurableEnvironment(org.springframework.core.env.ConfigurableEnvironment) SpringDynamicConfigService(com.netflix.spinnaker.kork.dynamicconfig.SpringDynamicConfigService) ConditionalOnProperty(org.springframework.boot.autoconfigure.condition.ConditionalOnProperty) com.netflix.spinnaker.kork.plugins(com.netflix.spinnaker.kork.plugins) VersionResolver(com.netflix.spinnaker.kork.version.VersionResolver) Logger(org.slf4j.Logger) PluginRepositoryProperties(com.netflix.spinnaker.config.PluginsConfigurationProperties.PluginRepositoryProperties) SpinnakerPluginService(com.netflix.spinnaker.kork.plugins.v2.SpinnakerPluginService) Import(org.springframework.context.annotation.Import) ApplicationContext(org.springframework.context.ApplicationContext) GenericApplicationContext(org.springframework.context.support.GenericApplicationContext) Paths(java.nio.file.Paths) CompositeFileDownloader(com.netflix.spinnaker.kork.plugins.update.downloader.CompositeFileDownloader) Registry(com.netflix.spectator.api.Registry) AggregatePluginInfoReleaseProvider(com.netflix.spinnaker.kork.plugins.update.release.provider.AggregatePluginInfoReleaseProvider) DynamicConfigService(com.netflix.spinnaker.kork.dynamicconfig.DynamicConfigService) Binder(org.springframework.boot.context.properties.bind.Binder) Bean(org.springframework.context.annotation.Bean) SpringPluginFactory(com.netflix.spinnaker.kork.plugins.v2.SpringPluginFactory) CompoundVerifier(org.pf4j.update.verifier.CompoundVerifier) UpdateRepository(org.pf4j.update.UpdateRepository) ConfigurableUpdateRepository(com.netflix.spinnaker.kork.plugins.update.repository.ConfigurableUpdateRepository) ConfigurableUpdateRepository(com.netflix.spinnaker.kork.plugins.update.repository.ConfigurableUpdateRepository) URL(java.net.URL) SneakyThrows(lombok.SneakyThrows) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

PluginRepositoryProperties (com.netflix.spinnaker.config.PluginsConfigurationProperties.PluginRepositoryProperties)4 URL (java.net.URL)4 Bean (org.springframework.context.annotation.Bean)3 TypeReference (com.fasterxml.jackson.core.type.TypeReference)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 KotlinModule (com.fasterxml.jackson.module.kotlin.KotlinModule)1 Registry (com.netflix.spectator.api.Registry)1 Beta (com.netflix.spinnaker.kork.annotations.Beta)1 DynamicConfigService (com.netflix.spinnaker.kork.dynamicconfig.DynamicConfigService)1 SpringDynamicConfigService (com.netflix.spinnaker.kork.dynamicconfig.SpringDynamicConfigService)1 com.netflix.spinnaker.kork.plugins (com.netflix.spinnaker.kork.plugins)1 FRAMEWORK_V1 (com.netflix.spinnaker.kork.plugins.PackageKt.FRAMEWORK_V1)1 FRAMEWORK_V2 (com.netflix.spinnaker.kork.plugins.PackageKt.FRAMEWORK_V2)1 InstalledPluginsEndpoint (com.netflix.spinnaker.kork.plugins.actuator.InstalledPluginsEndpoint)1 PluginBundleExtractor (com.netflix.spinnaker.kork.plugins.bundle.PluginBundleExtractor)1 com.netflix.spinnaker.kork.plugins.config (com.netflix.spinnaker.kork.plugins.config)1 InvocationAspect (com.netflix.spinnaker.kork.plugins.proxy.aspects.InvocationAspect)1 InvocationState (com.netflix.spinnaker.kork.plugins.proxy.aspects.InvocationState)1 LogInvocationAspect (com.netflix.spinnaker.kork.plugins.proxy.aspects.LogInvocationAspect)1 MetricInvocationAspect (com.netflix.spinnaker.kork.plugins.proxy.aspects.MetricInvocationAspect)1