Skip to content

Commit

Permalink
chore: add most of configuration properties to application.yml. Add l…
Browse files Browse the repository at this point in the history
…ogs when running on k8s
  • Loading branch information
filipowm committed Jan 3, 2022
1 parent ca5968f commit 491aa7f
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.roche.ambassador.advisor.badges

import com.roche.ambassador.advisor.common.AdvisorConfigurationException
import java.net.URLEncoder
import java.nio.charset.StandardCharsets

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.roche.ambassador.configuration

import com.roche.ambassador.extensions.LoggerDelegate
import org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform
import org.springframework.boot.cloud.CloudPlatform
import org.springframework.context.annotation.Configuration
import javax.annotation.PostConstruct

@Configuration
@ConditionalOnCloudPlatform(CloudPlatform.KUBERNETES)
internal class KubernetesConfiguration {

companion object {
private val log by LoggerDelegate()
}

@PostConstruct
fun onInit() {
log.info("Discovered that Ambassador is deployed on Kubernetes. Applied Kubernetes-specific configuration")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package com.roche.ambassador.configuration

import com.roche.ambassador.document.*
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
//@Configuration
internal open class TextAnalysisConfiguration {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ spring:
datasource:
url: jdbc:postgresql://localhost:5432/postgres
username: postgres
password: postgres
password: postgres

ambassador:
security:
enabled: false
14 changes: 0 additions & 14 deletions ambassador-application/src/main/resources/application-open-api.yml

This file was deleted.

32 changes: 31 additions & 1 deletion ambassador-application/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,44 @@ spring:
language: ${ambassador.language}
mixed: true

springdoc:
api-docs:
groups:
enabled: true
---
ambassador:
language: english
security:
enabled: false
enabled: true
indexer:
concurrency:
producerThreadPrefix: indxr-
consumerThreadPrefix: prj-indxr-
supportingThreadPrefix: spprt-
concurrencyLevel: 30
lock-type: in_memory
historySize: 10
gracePeriod: 7d
criteria:
projects:
excludeArchived: true
excludeForks: true
maxVisibility: internal
lastActivityWithin: 365d
mustHaveDefaultBranch: true
mustHaveNotEmptyRepo: true
mustBeAbleToCreateMergeRequest: true
mustBeAbleToFork: true
events:
async:
thread-name-prefix: events-
corePoolSize: 2
maxPoolsSize: 10
openapi:
title: The Ambassador API
contact:
name: Mateusz Filipowicz
url: https://github.com/Roche
license:
name: Apache-2.0
url: https://www.apache.org/licenses/LICENSE-2.0.txt
2 changes: 2 additions & 0 deletions infrastructure/compose/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ spring:
username: postgres
password: postgres
ambassador:
security:
enabled: false
source:
name: gitlab
url: http://fake
Expand Down

0 comments on commit 491aa7f

Please sign in to comment.