Skip to content

Commit

Permalink
chore(web): clean up for spring property setup
Browse files Browse the repository at this point in the history
Using `com.netflix.spinnaker.kork.boot.DefaultPropertiesBuilder` class to setup spring and other related properties required for the spring boot application to start.
  • Loading branch information
j-sandy committed Jan 23, 2023
1 parent 57432d8 commit b596c69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions gate-web/gate-web.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dependencies {
implementation "io.spinnaker.fiat:fiat-core:$fiatVersion"
implementation "io.spinnaker.fiat:fiat-api:$fiatVersion"

implementation "io.spinnaker.kork:kork-config"
implementation "io.spinnaker.kork:kork-plugins"
implementation "io.spinnaker.kork:kork-web"
implementation "com.netflix.frigga:frigga"
Expand Down
11 changes: 2 additions & 9 deletions gate-web/src/main/groovy/com/netflix/spinnaker/gate/Main.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.scheduling.annotation.EnableAsync
import com.netflix.spinnaker.kork.boot.DefaultPropertiesBuilder

@EnableAsync
@EnableConfigurationProperties
Expand All @@ -41,15 +42,7 @@ import org.springframework.scheduling.annotation.EnableAsync
)
class Main {

static final Map<String, String> DEFAULT_PROPS = [
'netflix.environment': 'test',
'netflix.account': '${netflix.environment}',
'netflix.stack': 'test',
'spring.config.additional-location': '${user.home}/.spinnaker/',
'spring.application.name': 'gate',
'spring.config.name': 'spinnaker,${spring.application.name}',
'spring.profiles.active': '${netflix.environment},local'
]
static final Map<String, String> DEFAULT_PROPS = new DefaultPropertiesBuilder().property("spring.application.name", "gate").build();

static void main(String... args) {
new SpringApplicationBuilder().properties(DEFAULT_PROPS).sources(Main).run(args)
Expand Down

0 comments on commit b596c69

Please sign in to comment.