Skip to content

Commit

Permalink
chore(web): clean up for spring property setup (spinnaker#4377)
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 authored Jan 23, 2023
1 parent 74e4f02 commit d823b68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions orca-web/orca-web.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ dependencies {
implementation(project(":orca-remote-stage"))
implementation(project(":orca-sql"))
implementation(project(":orca-webhook"))
implementation("io.spinnaker.kork:kork-config")
implementation("io.spinnaker.kork:kork-exceptions")
implementation("io.spinnaker.kork:kork-web")
implementation("io.spinnaker.kork:kork-plugins")
Expand Down
11 changes: 2 additions & 9 deletions orca-web/src/main/groovy/com/netflix/spinnaker/orca/Main.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
import org.springframework.context.annotation.Import
import org.springframework.scheduling.annotation.EnableAsync
import com.netflix.spinnaker.kork.boot.DefaultPropertiesBuilder

@EnableAsync
@Import([
Expand Down Expand Up @@ -71,15 +72,7 @@ import org.springframework.scheduling.annotation.EnableAsync
exclude = [BatchAutoConfiguration, GroovyTemplateAutoConfiguration, DataSourceAutoConfiguration]
)
class Main extends SpringBootServletInitializer {
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' : 'orca',
'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", "orca").build()

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

0 comments on commit d823b68

Please sign in to comment.