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