Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Run Yaml anchor based on your input

BHARATHKUREK June 27, 2021

Hello Everyone,

Is it possible right now to call the yaml anchor based on the user Input given.

For example: Lets say we have to give input as 'A' i should call Build, if i give input as 'B' , we should cal\run Build, dockerimage.

This i tried by giving user-input but i am not able to run the yaml anchors.

let me know your thoughts.

 

Thanks 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 2, 2021

Hi @BHARATHKUREK,

At the moment it is possible to give user input in custom pipelines only, you can check our documentation here (search for the 'variables' keyword).

I'm afraid that it is not possible to do that with yaml anchors and non-custom pipelines yet.

I found the following feature request in our issue tracker:

I believe that this is what you are looking for? If so, I would suggest that add your vote in the feature request (by selecting the Vote for this issue link) as the number of votes helps the development team and product managers better understand the demand for new features. You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy here and any updates will be posted in the feature request.

Please feel free to let me know if you have any questions.

Kind regards,
Theodora

BHARATHKUREK July 2, 2021

@Theodora Boudale  No both either documentation here (search for the 'variables' keyword) and BCLOUD-1955 are not my goal.

consider taskA and taskB as yaml anchors i can call when we need based on condition,simple if loop i have given as a use case.

let say i have 2 methods
taskA()
taskB()

 

When the bitbucket pipeline ask userinput if i enter 'A' or 'B' or 'C' it should perform the respective task

if (userinput == 'A')
taskA
else if (userinput == 'B')
taskB
else (userinput == 'C')
taskA
taskB

Thanks 

Like Kajsa likes this
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 5, 2021

Hi @BHARATHKUREK ,

Thank you for your input and for explaining your use case.

Bitbucket Pipelines is based on YAML, and I am not sure if YAML allows using anchors inside commands like in the example you gave.

I would suggest opening a feature request about this in our issue tracker (including your explanation and use case) for our development team to consider, if this is possible.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events