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?
Current Setup:
variables section that includes common variable.Goal:
common variable.Challenges:
variables section in Bitbucket pipelines is static and cannot be dynamically overridden within a single step.G'day, @Supul Pushpakumara
Welcome to the community!
I believe what you are looking for can be achieved through the use of dynamic pipelines.
Dynamic pipelines provide significant flexibility to traditionally static YAML pipeline configurations by allowing runtime modifications through application-level logic. One key feature they offer is the ability to utilize environment, repository, or workspace variables to define Docker image names for use in CI/CD workflows. This capability enables you to dynamically modify each step of the pipeline as needed.
I hope this helps.
Regards,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.