Cloud foundry 如何设置Pivotal Cloud Foundry配置服务器以使用my git repo的多个搜索路径?

Cloud foundry 如何设置Pivotal Cloud Foundry配置服务器以使用my git repo的多个搜索路径?,cloud-foundry,spring-cloud-config,configserver,Cloud Foundry,Spring Cloud Config,Configserver,我有一个本地配置服务器,它可以与像这样的yml配置设置一起工作吗 spring: cloud: config: server: git: uri: https://github.com/xxx/xxxxx search-paths: - 'kenya*' - 'tanzania*' - 'uganda*' - 'congo*'

我有一个本地配置服务器,它可以与像这样的yml配置设置一起工作吗

spring:
  cloud:
    config:
      server:
        git:
          uri: https://github.com/xxx/xxxxx
          search-paths:
          - 'kenya*' 
          - 'tanzania*' 
          - 'uganda*' 
          - 'congo*'
          - 'zimbabwe*'
在我的本地项目中,我可以访问所有这些回购协议,如

这将返回所选配置文件的正确文件

但是,当我设置Pivotal Config server时,无论我向路径中添加了什么参数,我都只获得默认属性

类似的内容只返回回购协议根的默认属性

我怎样才能使用电脑

此处所述的搜索路径


添加所有我的子文件夹的标志?

如果您使用的是Pivotal Spring云服务,您可以使用多个
搜索路径创建服务,如下所示:

cf create-service -c '{ "git": { "uri": "https://github.com/dmikusa-pivotal/cook-config.git", "label": "search-paths", "searchPaths": "dev,prod" } }' cook-config-server
curl -k -H "Authorization: bearer $(curl -k -s -X POST 'https://p-spring-cloud-services.uaa.<system_domain>/oauth/token' -d 'grant_type=client_credentials&client_id=<insert client id>&client_secret=<insert client_secret>' | jq .access_token | cut -d '"' -f 2)" <insert uri>/cook/prod
searchPaths
参数仅采用逗号分隔的搜索路径/模式列表

然后,指向的存储库应该具有名为
dev
prod
的顶级文件夹。然后,配置服务器将从搜索路径文件夹中返回
.properties
(它支持的所有其他变体)

通过运行以下命令,您可以验证是否正在接收多个搜索路径的数据:

cf create-service -c '{ "git": { "uri": "https://github.com/dmikusa-pivotal/cook-config.git", "label": "search-paths", "searchPaths": "dev,prod" } }' cook-config-server
curl -k -H "Authorization: bearer $(curl -k -s -X POST 'https://p-spring-cloud-services.uaa.<system_domain>/oauth/token' -d 'grant_type=client_credentials&client_id=<insert client id>&client_secret=<insert client_secret>' | jq .access_token | cut -d '"' -f 2)" <insert uri>/cook/prod

希望有帮助

如果您使用的是Pivotal Spring云服务,您可以使用多个
搜索路径创建服务,如下所示:

cf create-service -c '{ "git": { "uri": "https://github.com/dmikusa-pivotal/cook-config.git", "label": "search-paths", "searchPaths": "dev,prod" } }' cook-config-server
curl -k -H "Authorization: bearer $(curl -k -s -X POST 'https://p-spring-cloud-services.uaa.<system_domain>/oauth/token' -d 'grant_type=client_credentials&client_id=<insert client id>&client_secret=<insert client_secret>' | jq .access_token | cut -d '"' -f 2)" <insert uri>/cook/prod
searchPaths
参数仅采用逗号分隔的搜索路径/模式列表

然后,指向的存储库应该具有名为
dev
prod
的顶级文件夹。然后,配置服务器将从搜索路径文件夹中返回
.properties
(它支持的所有其他变体)

通过运行以下命令,您可以验证是否正在接收多个搜索路径的数据:

cf create-service -c '{ "git": { "uri": "https://github.com/dmikusa-pivotal/cook-config.git", "label": "search-paths", "searchPaths": "dev,prod" } }' cook-config-server
curl -k -H "Authorization: bearer $(curl -k -s -X POST 'https://p-spring-cloud-services.uaa.<system_domain>/oauth/token' -d 'grant_type=client_credentials&client_id=<insert client id>&client_secret=<insert client_secret>' | jq .access_token | cut -d '"' -f 2)" <insert uri>/cook/prod
希望有帮助