Codemagic 是否可以拥有多个 codemagic.yaml 文件?
Is it with Codemagic possible to have multiple codemagic.yaml files?
我正在为我的 Flutter 使用 Codemagic CI。对于我的 repo,我使用的是 monorepo 结构。所以我将我的存储库分成 +20 个本地包。对于每个包,我 运行 都有自己的工作流程(分析、测试、格式化等)。
由于包数较多,codemagic.yaml成为一个庞大的文件,可读性下降。
通过 GitHub 操作,我能够将我的工作流程拆分为多个文件,这大大提高了可读性(每个包一个文件)。
我询问了 Codemagic 团队并得到了这个答案:
Unfortunately we do not plan on introducing the feature to split configurations into multiple different files at this point.
[But] there’s a couple of things you could look at doing. Firstly, take a look into using YAML anchors and aliases so you don’t repeat scripts. Here’s a guide and a sample codemagic.yaml.
The other option is to use the Codemagic REST API to trigger your builds and pass app specific environment variables for the build. In this was you can has a single workflow which you pass the variables too. See more about the API here.
There’s a few script samples here that show how to call it, and this yaml shows where the environment variables are overwritten.
我正在为我的 Flutter 使用 Codemagic CI。对于我的 repo,我使用的是 monorepo 结构。所以我将我的存储库分成 +20 个本地包。对于每个包,我 运行 都有自己的工作流程(分析、测试、格式化等)。
由于包数较多,codemagic.yaml成为一个庞大的文件,可读性下降。
通过 GitHub 操作,我能够将我的工作流程拆分为多个文件,这大大提高了可读性(每个包一个文件)。
我询问了 Codemagic 团队并得到了这个答案:
Unfortunately we do not plan on introducing the feature to split configurations into multiple different files at this point.
[But] there’s a couple of things you could look at doing. Firstly, take a look into using YAML anchors and aliases so you don’t repeat scripts. Here’s a guide and a sample codemagic.yaml. The other option is to use the Codemagic REST API to trigger your builds and pass app specific environment variables for the build. In this was you can has a single workflow which you pass the variables too. See more about the API here. There’s a few script samples here that show how to call it, and this yaml shows where the environment variables are overwritten.