I have defined a reusable step in my Bitbucket pipeline that runs a script for different IMAGE_NAME values. Currently, I pass the IMAGE_NAME one by one in the script section for each step. Is there a way to pass all the IMAGE_NAME values together to a single step, or iterate over them without overriding the variables section for each step?
Details:
Current Setup:
- A reusable step is defined with a
variables section that includes common variable. - The step is reused multiple times, each time with a different variable value.
Goal:
- Simplify the pipeline by passing all common variable values together to a single step.
- Avoid duplicating the step for each
common variable.
Challenges:
- The
variables section in Bitbucket pipelines is static and cannot be dynamically overridden within a single step. - Iterating over a list of values within a single step is not natively supported in Bitbucket pipelines.