Need to generate dynamic stages/steps
Feature request
Need a way to generate a steps for next stage.
Let's say I have Stage 1 -> Prepare for next stage. In this stage I will decide which steps I need in next stage.
Scenario -1
Stage 1 -> Prepare for next stage
Stage 2 -> Code scan -> Code unit test
Scenario -2
Stage 1 -> Prepare for next stage
Stage 2 -> Code scan -> Code build -> Code refactor
I want to control which steps will be executed in stage 1, I need a way to dynamically generate next stages/steps from the current stage.
There are a number of ways you could achieve this today depending on your specific needs. Here are some examples.
You can guard Task execution using when expressions, and use results from a previous Task as input to the when expressions, and only execute the appropriate Tasks base on the results of your stage 1 prepare step.
Alternatively you could have one PipelineRun for stage 1 which then creates another referencing a different Pipeline as appropriate.
Matrix is another possibility, allowing you to dynamically fan out Tasks in a Pipeline based on params, results, etc.
If you're specifically looking for a way to dynamically alter the definition of the Pipeline at runtime that's not currently supported.
If you're specifically looking for a way to dynamically alter the definition of the Pipeline at runtime that's not currently supported.
I am looking for this feature. Can this be priortized ?
You can find details of the TEP process for proposing new features at https://github.com/tektoncd/community/blob/main/process/README.md#proposing-features
You can also join us on Slack: https://github.com/tektoncd/community/blob/main/contact.md#slack Posting in the #pipeline channel could be a good way to get input from others in the community who may have similar needs or may propose other existing solutions.