Add force-pull property documentation

This commit is contained in:
Marcos Barbero
2016-12-21 12:03:34 +01:00
parent 47aa19fa87
commit 7fe44a0d86

View File

@@ -359,6 +359,58 @@ searches the repository for files in the same name as the directory
path with placeholders (any matching directory is included in the
search).
===== Force pull in Git Repositories
As mentioned before Spring Cloud Config Server makes a clone of the
remote git repository and if somehow the local copy gets dirty (e.g.
folder content changes by OS process) so Spring Cloud Config Server
cannot update the local copy from remote repository.
To solve this there is a `force-pull` property that will make Spring Cloud
Config Server force pull from remote repository if the local copy is dirty.
Example:
[source,yaml]
----
spring:
cloud:
config:
server:
git:
uri: https://github.com/spring-cloud-samples/config-repo
force-pull: true
----
If you have a multiple repositories configuration you can configure the
`force-pull` property per repository. Example:
[source,yaml]
----
spring:
cloud:
config:
server:
git:
uri: https://git/common/config-repo.git
force-pull: true
repos:
team-a:
pattern: team-a-*
uri: http://git/team-a/config-repo.git
force-pull: true
team-b:
pattern: team-b-*
uri: http://git/team-b/config-repo.git
force-pull: true
team-c:
pattern: team-c-*
uri: http://git/team-a/config-repo.git
----
NOTE: The default value for `force-pull` property is `false`.
==== Version Control Backend Filesystem Use
WARNING: With VCS based backends (git, svn) files are checked out or cloned to the local filesystem. By default they are put in the system temporary directory with a prefix of `config-repo-`. On linux, for example it could be `/tmp/config-repo-<randomid>`. Some operating systems http://serverfault.com/questions/377348/when-does-tmp-get-cleared/377349#377349[routinely clean out] temporary directories. This can lead to unexpected behaviour such as missing properties. To avoid this problem, change the directory Config Server uses, by setting `spring.cloud.config.server.git.basedir` or `spring.cloud.config.server.svn.basedir` to a directory that does not reside in the system temp structure.