Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I pass predefined variables as a list to a step in a Bitbucket pipeline?

Supul Pushpakumara
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 18, 2025

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:

  1. 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.
  2. Goal:

    • Simplify the pipeline by passing all common variable values together to a single step.
    • Avoid duplicating the step for each common variable.
  3. 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.

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events