Skip to content

Commit

Permalink
feat(core): Use Spring Cloud Config for external configuration of acc…
Browse files Browse the repository at this point in the history
…ounts (#636)
  • Loading branch information
scottfrederick authored and Jammy Louie committed Sep 3, 2019
1 parent 00ead20 commit ed001d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
1 change: 1 addition & 0 deletions echo-web/echo-web.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dependencies {
implementation "org.springframework.boot:spring-boot-starter-web"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "com.netflix.spinnaker.kork:kork-core"
implementation "com.netflix.spinnaker.kork:kork-config"
implementation "com.netflix.spinnaker.kork:kork-secrets-aws"
implementation "com.netflix.spinnaker.kork:kork-stackdriver"
implementation "com.netflix.spinnaker.kork:kork-web"
Expand Down
19 changes: 4 additions & 15 deletions echo-web/src/main/java/com/netflix/spinnaker/echo/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.netflix.spinnaker.echo;

import java.util.Collections;
import java.util.HashMap;
import com.netflix.spinnaker.kork.boot.DefaultPropertiesBuilder;
import com.netflix.spinnaker.kork.configserver.ConfigServerBootstrap;
import java.util.Map;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
Expand All @@ -34,21 +34,10 @@
@EnableScheduling
@ComponentScan({"com.netflix.spinnaker.echo.config", "com.netflix.spinnaker.config"})
public class Application extends SpringBootServletInitializer {
private static final Map<String, Object> DEFAULT_PROPS = buildDefaults();

private static Map<String, Object> buildDefaults() {
Map<String, String> defaults = new HashMap<>();
defaults.put("netflix.environment", "test");
defaults.put("netflix.account", "${netflix.environment}");
defaults.put("netflix.stack", "test");
defaults.put("spring.config.additional-location", "${user.home}/.spinnaker/");
defaults.put("spring.application.name", "echo");
defaults.put("spring.config.name", "spinnaker,${spring.application.name}");
defaults.put("spring.profiles.active", "${netflix.environment},local");
return Collections.unmodifiableMap(defaults);
}
private static final Map<String, Object> DEFAULT_PROPS = new DefaultPropertiesBuilder().build();

public static void main(String... args) {
ConfigServerBootstrap.systemProperties("echo");
System.setProperty("spring.main.allow-bean-definition-overriding", "true");
new SpringApplicationBuilder().properties(DEFAULT_PROPS).sources(Application.class).run(args);
}
Expand Down

0 comments on commit ed001d9

Please sign in to comment.