Hi, I have tried below code
version: 2
plan:
project-key: MYPROJECT
key: MYPLAN
name: My Plan
stages:
- Stage 1:
jobs:
- job1
- Stage 2:
final: true
jobs:
- job2
jobs:
- job1:
key: JOB1
tasks:
- script:
- echo "Running Job 1"
- exit 1 # Simulate failure
- job2:
key: JOB2
tasks:
- script:
- echo "Running Job 2"
- if [ "$bamboo_buildFailed" = "true" ]; then
echo "Job 1 failed, but continuing with Job 2";
else
echo "Job 1 succeeded, continuing with Job 2";
fi
Expectation:-
Plan should be marked as successful.
AIM:-
Overall plan should not be marked as failed even if Stage 1
fails, and Stage 2
will always run.
Hey Suprabhat
Welcome to Atlassian community.
Final stage just Runs regardless of the outcome of the previous stages, even if it is failed or passed, but the overall build will show as failed.
The corresponding Job under the Final stage will show as passed.
Regards,
Shashank Kumar
**please don't forget to Accept the answer if your query was answered**
Thanks for your reply. So it seems build cannot be marked as passed, it will still remain in failed status.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes you are right!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.