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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,751
Community Members
 
Community Events
176
Community Groups

Can we add a pipeline step that will execute even on previous steps failed (not after script)

I've configured runner in EC2 and I've below steps for test automation executions

Step1 - Start machine (runs on - Bitbucket image)

Step2- Run automation scripts (run on - self hosted runner)

Step3- Stop machine(run on - Bitbucket image)

If step2 failed due to some failed tests , Step2 will be skipped. But i want to close the EC2 instance in step3 . 

 

1 answer

0 votes
Mark C Atlassian Team May 08, 2022

Hi @Chandramouli Naraharisetti

Thank you for reaching out to the community.

Unfortunately, while using the Bitbucket Pipelines multi-steps, if you have 3 steps and the 1st or 2nd step is failed, it won't proceed to the 2nd or 3rd step.

For this, the best I can suggest is to catch the scenario you've described using after-script.

For example, in your 2nd step, you can set up after-script that when step 2 is failed, go ahead and close the EC2 instance.

  • Step 1:
  • Step 2:
    • after-script
      • If: Failed
        • Do close EC2 instance
      • Else: Success
        • Do something else/nothing
  • Step 3: Do close EC2 instance

Essentially, your after-script scripts for the 2nd and 3rd steps are slightly the same. (This is because, in the 2nd step's after-script, you'll need to do an if/else)

Hope it helps and let me know if you have further questions.

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events