Here's the use case: Let's say we have multiple repositories, each deploying a microservice. I'd like to give the Developers the possibility to simply write:
pipelines:
default:
- deploy-to-environment:
environment: dev
And then make my Dynamic Pipeline replace deploy-to-environment entry with a stage that runs terraform plan, terraform apply, some post-deployment test, tagging commit with environment tag, and perhaps few other steps.
Issues:
The only solution I thought of so far, is to create a script entry, and then use some convention in there, like:
pipelines:
default:
- step:
script:
- |
replaceWithStage({
id: "deploy-to-environment"
parameters:
environment: dev
})
And then try to evaluate that within Dynamic Pipeline App. Not yet sure if that would work.
Other things I considered:
Isn't there any other solution to simply reuse a definition of a stage, and be able to parameterize it?