# YML 中的环境变量 - 仅替换为操作系统的变量

**URL:** <https://meta.discourse.org/t/env-vars-in-yml-only-substituded-with-os-ones/280032>\
**Category:** Self-hosting\
**Created:** [2023 年9 月 25 日 15:53 UTC](https://meta.discourse.org/t/env-vars-in-yml-only-substituded-with-os-ones/280032 "2023-09-25T15:53:26Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

作者： ![lejeczek](https://avatars.discourse-cdn.com/v4/letter/l/edb3f5/32.png) [@lejeczek](https://meta.discourse.org/u/lejeczek)\
发布日期： [2023 年9 月 25 日 18:06 UTC](https://meta.discourse.org/t/env-vars-in-yml-only-substituded-with-os-ones/280032/5 "2023-09-25T18:06:22Z")

</div>

这些小的_调整_在扩展时非常有用，即使只是微小的扩展。  
上面那个例子应该最能说明问题——无需每次在不同环境/不同主机上 **构建** 时都在 **yaml** 中进行“修复”。  
我搜索了一下，看到一些例子声称这种简单的替换应该适用于 YAML，但我无法使其生效。

---

_[View the full topic](https://meta.discourse.org/t/env-vars-in-yml-only-substituded-with-os-ones/280032)._
