CircleCi动态config / config beartswand
有人知道是否有可能将CircleCi的配置文件分解为每个作业,命令,工作流等的较小文件,它是在其自己的特定文件/子目录中,如果是的,您将如何处理?
我一直在环顾四周,甚至试图构建一个Python脚本来从所有这些YAML文件中构建配置,但是由于这些各种文件中未存在的参考变量名称而没有运气,因此Pyyaml库不会加载它们。
我要实现的是要拥有此文件夹结构
configs/
dependencies.yml
commands/
command_1.yml
command_2.yml
jobs/
job_1.yml
job_2.yml
workflows/
workflow_1.yml
workflow_2.yml
,其中dependencies.yml
包含每个工作流程所需的内容,就每个步骤&gt中使用的内容而言; Job>命令。而且该文件将被手写。
Does anyone know if it's possible to breakdown the config file for circleci into smaller files where each job, command, workflow, etc, is in it's own specific file/subdirectory, and if so, how would you approach this?
I've been looking around and even attempted myself to build a python script to build a config from all these yaml files, but with no luck due to reference variable names not existing in these various files so pyyaml library won't load them.
What I'm trying to accomplish is to have this folder structure
configs/
dependencies.yml
commands/
command_1.yml
command_2.yml
jobs/
job_1.yml
job_2.yml
workflows/
workflow_1.yml
workflow_2.yml
Where dependencies.yml
contains a breakdown of what each workflow requires in terms of what is used in each step > job > command. And this file would be hand written.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以执行以下操作:
原始config.yml to Split:
在新文件夹中创建sufter conter contraut in New文件夹,称为config(run
tree
):@orbs。 yml包含
@workflows.yml包含
my-job.yml包含
,主config.yml应该看起来像:
You can do the following :
Example original config.yml to split:
Create following layout in a new folder called config (run
tree
):@orbs.yml contains
@workflows.yml contains
my-job.yml contains
And the main config.yml should look like: