pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

Need to generate dynamic stages/steps

Open akshayvijapur opened this issue 2 years ago • 3 comments

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.

akshayvijapur avatar Dec 01 '23 13:12 akshayvijapur

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.

AlanGreene avatar Dec 03 '23 18:12 AlanGreene

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 ?

akshayvijapur avatar Dec 04 '23 05:12 akshayvijapur

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.

AlanGreene avatar Dec 04 '23 11:12 AlanGreene