【发布时间】:2021-11-17 17:42:29
【问题描述】:
我正在使用需要部署到 openshift 4 的 spring boot 应用程序。我创建了一个私有映像注册表。 openshift 从这个私有存储库中提取图像。 我在spring boot应用程序的spring profile(名为openshift)中设置了env变量,如下所示:
- 应用程序-openshift.yaml
弹簧: 数据源: url: jdbc:oracle:thin:@//${DB_URL} 用户名:${DB_USERNAME} 密码:${DB_PASSWORD}
数据源属性在 intellij idea 中设置为环境变量。 现在每当我将应用程序部署到 openshift 时。 spring 应用程序将配置文件作为默认配置并忽略此 openshift 配置文件。
谁能建议我做错了什么? oc env 命令在命令行中对我不起作用。
【问题讨论】:
标签: spring-boot deployment environment-variables openshift