Created
March 17, 2016 23:40
-
-
Save norbertpotocki/dacdcc6671a2158ded5e to your computer and use it in GitHub Desktop.
Configuration source backed by git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean | |
ConfigurationProvider configurationProvider(@Value("${configuration.environment}") String configurationEnvironment) { | |
ConfigurationSource GitSource = new GitConfigurationSourceBuilder() | |
.withRepositoryURI("https://Github.com/myUser/my-config-fork.Git") | |
.build(); | |
return new ConfigurationProviderBuilder() | |
.withConfigurationSource(GitSource) | |
.withEnvironment(new ImmutableEnvironment("app/" + configurationEnvironment + "/feature")) | |
.withReloadStrategy(new PeriodicalReloadStrategy(30, TimeUnit.SECONDS)) | |
.build(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment