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 .
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.