Bitbutcket pipeline Don't fail the step

Shubhendu Pandey July 30, 2020

Hi 

I am running all my test cases and some of them get fail sometimes, pipeline detects it and fail the step and build. this blocks the next step to be executed (zip the report folder). I want to send that zip file as an email attachment. 

Here is my  bitbucket-pipeline.yml file 

custom: # Pipelines that can only be triggered manually
QA2: # The name that is displayed in the list in the Bitbucket Cloud GUI
- step:
image: openjdk:8
caches:
- gradle
size: 2x # double resources available for this step to 8G
script:
- apt-get update
- apt-get install zip
- cd config/geb
- ./gradlew -DBASE_URL=qa2 clean BSchrome_win # This step fails
- cd build/reports
- zip -r testresult.zip BSchrome_winTest

after-script: # On test execution completion or build failure, send test report to e-mail lists
- pipe: atlassian/email-notify:0.3.11
variables:
<<: *email-notify-config
TO: 'email@email.com'
SUBJECT: "Test result for QA2 environment"
BODY_PLAIN: |
Please find the attached test result report to the email.
ATTACHMENTS: config/geb/build/reports/testresult.zip

 Screenshot:-  

Steps - cd build/reports and - zip -r testresult.zip BSchrome_winTest doesn't get executed because - ./gradlew -DBASE_URL=qa2 clean BSchrome_win got failedscreenshot17_50_47.png

How do I make a look build/step pass every time?

1 answer

1 accepted

1 vote
Answer accepted
ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 4, 2020

This might already do it: Put all actions that should be done even on failure into the after-script, e.g. as well changing directory and creating the zip file.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events