希望通过动作部署到多个环境。环境是我们的逻辑环境,例如Dev,UAT,Pro等。所有环境都相同。
鉴于部署是部署X,Y,Z
,X,Y,Z是每个环境值不同的变量,在操作中处理此操作的最佳实践是什么?
章鱼具有范围的变量。定义一次和每个环境值。
我考虑过以下一些选项:
定义和:
- 使用环境秘密 - con是非秘密的可维护性(不能仅仅看到普通文本事物)
- 开关型在操作环境上以设置env vars(迄今为止最好)
=“ https://docs.github.com/en/actions/deployment/targeting-different-environments/ususe-environments-for-deployment操作环境 似乎是每环境差异化的方法,但是要保持github中的var值,并且感觉应该完全被外部化,因为没有“ config”的机制。
如果您遇到了此类案件,请告诉我。谢谢!
编辑:12因子应用程序说“在环境中存储配置”,我认为这意味着在AWS中,我具有每个ENV SSM参数,并使用GH操作环境将各自的参数值拉入env vars。这感觉最正确。
Looking to deploy with actions to multiple environments. Environments are our logical environments, like Dev, Uat, Pro, etc. Deploy mechanic is same for all environments.
Given that the deploy is deploy x, y, z
, and x, y, z are variables with differing values for each environment, what is the best practice for handling this in actions?
Octopus has scoped variables. Defined once, and per-environment values.
Here are some options I considered:
Define Actions Environments and:
- Use Environment Secrets - con is maintainability for non-secrets (can't just see plain-text things)
- SWITCH-type statement on Actions Environment to set env vars (seems best so far)
The Actions Environments seems to be the way to go for per-environment differentiation, but it's smelling to keep the var values in GitHub and feeling like should be externalized completely as there's no mechanism for "config".
Please let me know if you have approached such case. Thanks!
Edit: 12-factor app says "store config in the environment" and I think that means in AWS, that I have per-env SSM params and use the GH Actions Environments to pull the respective params' values into env vars. This feels most correct.
发布评论