Document the new local config YAML features

Also remove --git-url command line flag (since you can
put it in configserver.yml now).
This commit is contained in:
Dave Syer
2016-08-15 16:46:42 +01:00
parent 072cb9de21
commit 9d44ed2631
4 changed files with 24 additions and 17 deletions

View File

@@ -138,15 +138,15 @@ public class DeployerThread extends Thread {
PropertySource<?> source = null;
Resource resource = new ClassPathResource("config" + path, DeployerThread.class);
source = loadPropertySource(resource, path);
if (source==null) {
if (source == null) {
resource = new ClassPathResource(path, DeployerThread.class);
source = loadPropertySource(resource, path);
}
if (source==null) {
if (source == null) {
resource = new FileSystemResource("config" + path);
source = loadPropertySource(resource, path);
}
if (source==null) {
if (source == null) {
resource = new FileSystemResource("." + path);
source = loadPropertySource(resource, path);
}
@@ -156,8 +156,9 @@ public class DeployerThread extends Thread {
private PropertySource<?> loadPropertySource(Resource resource, String path) {
if (resource.exists()) {
try {
PropertySource<?> source = new YamlPropertySourceLoader().load(path, resource, null);
if (source!=null) {
PropertySource<?> source = new YamlPropertySourceLoader().load(path,
resource, null);
if (source != null) {
logger.info("Loaded YAML properties from: " + resource);
}
return source;
@@ -261,12 +262,6 @@ public class DeployerThread extends Thread {
for (String key : map.keySet()) {
appDefProps.put(key, map.get(key));
}
if (deployable.getName().equals("configserver")
&& environment.containsProperty("git.uri")) {
appDefProps.put("spring.profiles.active", "git");
appDefProps.put("spring.cloud.config.server.git.uri",
environment.getRequiredProperty("git.uri"));
}
AppDefinition definition = new AppDefinition(deployable.getName(), appDefProps);