Spring Cloud config-git back end

Source: Internet
Author: User
Tags tag name

EnvironmentRepository's default implementation uses the Git backend, which is handy 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) in config server application.yml . If you file: set up with a 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 never changes 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 protocol of the shared file system repository ssh: so that the server can clone it and use the local working copy as the cache.

The repository implementation maps the parameters of an HTTP resource {label} to a git tag (commit ID, branch name, or label). If the Git branch or tag name contains a slash ("/"), you should specify the label in the HTTP URL with a special string "(_)" 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 {application} and {profile} (as well {label} ) placeholders, and, if necessary, remember that the tag 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 mode but use {profile} the "one per profile" policy.

Source source technical support for complete projects 1791743380

Spring Cloud config-git back end

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.