【问题标题】:To bring up a spring-cloud-config-server component with multiple git url调出带有多个 git url 的 spring-cloud-config-server 组件
【发布时间】:2019-07-19 20:36:06
【问题描述】:

如何将一个 URI 映射到 spring-cloud-config 服务器的 application.yml 中的另一个 URI?

我正在尝试使用 Jenkins 部署我的 spring-cloud-config-server 应用程序。我已将 Git URL 定义为 <gitRepo>/{profile}-application.properties。因为我在不发送配置文件的情况下部署应用程序,所以它采用默认配置,因为配置文件和应用程序试图到达不存在的 <gitRepo>/default-application.properties,因此作为 jenkins 管道的一部分,应用程序的运行状况检查失败.

我现在想将 URI:<gitRepo>/default-application.properties 映射到 URI:<gitRepo>/cit-application.properties

这可以在 YML 中完成吗?我找到了很多方法来仅基于存储库拥有多个 URI,但这不是我想要的。

    spring:
      cloud:
        config:
          server:
            git:
              uri: https://<gitrepo>/{profile}-configuration.git

                pattern:
                    - '*/default-configuration'
                uri: https://<gitrepo>/cit-configuration.git

【问题讨论】:

  • 我建议在单独的代码块中添加相关的配置文件内容。这可能是 Jenkins 配置的一些可能相关的内容。我想知道的是“映射”URI是什么意思?有很多方法可以来回映射 URI,但我觉得您正在尝试寻找解决方法。
  • 嗨,伊戈尔,感谢您的回复。我的意思是在 yml 中添加一条规则来映射 uri:https:///default-configuration.git 路径:模式:-'/default' uri:repo/cit-configuration.git 这个想法是匹配传入 URI 路径中的模式并将其映射到下面的 uri。这似乎不起作用,还有什么可以做的吗?

标签: java yaml spring-cloud-config


【解决方案1】:

我们已通过使用禁用运行状况检查 健康检查: 启用:假

这帮助我们解决了问题。

【讨论】:

    猜你喜欢
    • 2020-04-22
    • 2021-05-25
    • 2020-07-02
    • 1970-01-01
    • 1970-01-01
    • 2020-01-18
    • 2015-06-18
    • 1970-01-01
    • 2016-07-06
    相关资源
    最近更新 更多