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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Run Yaml anchor based on your input

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

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

@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 

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
Community showcase
Published in Bitbucket Pipelines

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

3,782 views 64 20
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you