The default implementation of Environmentrepository uses the Git backend, which is convenient for managing upgrades and physical environments, as well as auditing changes. To change the location of the repository, you can set the "Spring.cloud.config.server.git.uri" configuration property (for example, application.yml) in config server. If you set up with the file: prefix, you should work from the local repository so that you can start quickly and easily without a server, but in this case the server will operate directly on the local repository without cloning if it is not bare metal, because the configuration server will never change the remote repository. To extend the config server and make it highly available, you need to point all instances of the server to the same repository, so only the shared file system will work correctly. Even in this case, it is best to use the SSH: protocol of the shared file system repository so that the server can clone it and use the local working copy as the cache.
The repository implementation maps the {label} parameter of an HTTP resource to a git tag (commit ID, branch name, or label). If the Git branch or tag name contains a slash ("/"), you should use a special string "(
Specify the label in the HTTP URL to avoid blurring with other URL paths. For example, if the label is Foo/bar, replacing the slash will cause the label to look like Foo () bar. If you use a command-line client like curl (for example, using quotation marks to relay it out of the shell), be careful with the square brackets in the URL.
Placeholders in the Git URI
The Spring Cloud config server supports a git repository URL that contains placeholders for {application} and {profile} (as well as {label}), and, if necessary, remember that the label is applied as a git tag. Therefore, you can easily support the "one repo per application" policy using (for example):
Spring
Cloud
Config
Server
Git:
Uri:https://github.com/myorg/{application}
Or use a similar pattern but use the "one per profile" policy with {profiles}.
Spring Cloud config-git back end