From 7fe44a0d86e6470dc5cd64cbae71b1d54f885575 Mon Sep 17 00:00:00 2001 From: Marcos Barbero Date: Wed, 21 Dec 2016 12:03:34 +0100 Subject: [PATCH] Add force-pull property documentation --- .../main/asciidoc/spring-cloud-config.adoc | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/docs/src/main/asciidoc/spring-cloud-config.adoc b/docs/src/main/asciidoc/spring-cloud-config.adoc index 9bf6682f..e4e5553a 100644 --- a/docs/src/main/asciidoc/spring-cloud-config.adoc +++ b/docs/src/main/asciidoc/spring-cloud-config.adoc @@ -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-`. 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.