Submit Your Ideas

We want to hear from you - vote for the features and improvements you'd most like to see, or submit your own ideas if you don't find them already listed.

Allow nested lists in config.yml. `steps` List

Often I repetition inside the jobs-steps-List. By leveraging YAML alias and references one could have a macro like functionality in config.yml: 

stepslist: &stepslist
- checkout:
path: ~/repo
- run: doit -f dodo-new.py submodules
- restore_cache: …
- run: doit -f dodo-new.py BUILD
- save_cache: …

jobs:
build:…
steps:
- *stepslist
- run: doit -f dodo-new.py CICHECK CITEST


Using YAML  `<<:` merge as suggested in https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/ does not work with steps because steps is a list. Do the config shown above dos not work currently.
But if Circle CI would accept a list of lists (basically run `steps.flatten()`) it would enable using this functionality reducing config duplication without much added complexity. 

https://discuss.circleci.com/t/yaml-anchors-implementation-incomplete/16916 is the same problem.

  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • May 22 2018
  • Shipped
  • Attach files
  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    22 May 12:36
  • Admin
    Nathan Dintenfass commented
    22 May 17:59

    We will be providing something akin to this in a coming set of configuration improvements -- we will let you define a command that is a set of parametrizable steps you can invoke in a job.

  • Admin
    Nathan Dintenfass commented
    07 Dec 22:09

    You can now do this with the `commands` stanza. https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-commands