【问题标题】:How to deploy different bootstrap.properties to different environments with Aws Code Pipeline如何使用 Aws Code Pipeline 将不同的 bootstrap.properties 部署到不同的环境
【发布时间】:2018-10-11 14:14:34
【问题描述】:

所以我有一个无服务器的 Spring Boot 应用程序,我目前使用代码管道部署到 aws。这个 Spring Boot 应用程序使用 bootstrap.properties 文件来调用我们用于属性的云配置服务器。我遇到的问题是我无法弄清楚如何让代码管道为它部署到的每个环境部署不同的 bootstrap.properties 文件,以便我可以简化流程并让每个环境访问自己的属性。有谁知道有没有办法做到这一点?

【问题讨论】:

    标签: amazon-web-services spring-boot spring-cloud aws-codepipeline


    【解决方案1】:

    bootstrap-[profile].properties 允许您结合激活的弹簧配置文件为每个环境加载不同的变量

    例如

    1. (默认)bootstrap.properties

    2. (SPRING_PROFILES_ACTIVE=prod) bootstrap-prod.properties

    【讨论】:

      猜你喜欢
      • 2021-10-19
      • 2019-12-10
      • 2015-07-05
      • 1970-01-01
      • 1970-01-01
      • 2011-11-29
      • 1970-01-01
      • 1970-01-01
      • 2023-03-03
      相关资源
      最近更新 更多