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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Staging feature in Bitbucket cloud

Bitbucket has one stage feature that allows to have multiple steps inside a single stage and i was trying to find out the correct approach to do this with the  Allowed parent properties as  default, branches, pull-requests, tags, and custom. When i was trying in VS code and it gives me  Code Property stage is not allowed. Can someone give me the correct way of doing this part. Below is the method that i was trying and attached the screenshots for the same 

 

image: hashicorp/terraform:latest
pipelines:
  branches:
     '{feature-dev-*,feature-qa-*,feature-master-*}':
       - stage:
           name: Build and test
           steps:
            - step:
                name: Deploy
                script:
                    - |
                     branch=$(echo $BITBUCKET_BRANCH | awk -F'-' '{print tolower($2)}')


property.png

 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 26, 2023

Hi Vysakh and welcome to the community!

The bitbucket-pipelines.yml file you posted here is valid. I tried running a build with this yml and there were no issues.

You can use the following validator to validate your bitbucket-pipelines.yml file:

Just a heads up, there is a bug with the validator when yaml anchors are used. In this case, the validator doesn't show any errors.

VS code is not built by Atlassian, so I'm not sure why it shows an error and how exactly it does the validation. If you want to find out, it may be best to reach out to a VS Code-specific forum or the product's support team.

Kind regards,
Theodora

Hi Theodora,

Thanks for your comments regarding this issue. When I introduced the stage feature  I got the below error from the pipeline. Please look this one as well

 

image.png
Thanks 

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 27, 2023 • edited Sep 29, 2023

Hi Vysakh,

This error shows when there is an error with indentation.

  • Please make sure that you use indentation with spaces (not tabs).
  • You need to use at least 1 space for indentation, except for everything listed under - step: and - stage: which should be at least 3 spaces.

You can try with indentation as follows: (Edited to correct the yml indentation)

image: hashicorp/terraform:latest
pipelines:
branches:
'{feature-dev-*,feature-qa-*,feature-master-*}':
- stage:
name: Build and test
steps:
- step:
name: Deploy
script:
- |
branch=$(echo $BITBUCKET_BRANCH | awk -F'-' '{print tolower($2)}')

Please feel free to let me know how it goes.

Kind regards,
Theodora

Like Sabine Mayer likes this

Hi Theodora,
Thanks for your reply and there was a slight change in the code that you shared above. It should be:

image: hashicorp/terraform:latest
pipelines:

Once more thanks for the correction in the stage section. Now the pipeline is working as I expected.
Thanks and Regards
Vysakh M

Like Theodora Boudale likes this
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 29, 2023

Hi Vysakh,

You are absolutely right, I slipped up. I will edit my reply to avoid confusion.

It's good to hear that the pipeline is working now. Please feel free to reach out if you ever need anything else!

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events