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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Failed attachment index.html to email Edited

Hi 

I am getting "Failed to add an attachment. No such file index.html" error 

This is my bitbucket-pipeline.yml file code

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:
- cd config/geb
- ./gradlew -S clean browerstackchTest
- echo "Manual trigger for QA2!"
after-script: # on failed builds send notifications to e-mail lists in addition to the committer
- if [ "${BITBUCKET_EXIT_CODE}" == "0" ]; then exit 0; else echo "gradle build step failed"; fi
- pipe: atlassian/email-notify:0.3.11
variables:
<<: *email-notify-config
TO: 'email@email.com'
SUBJECT: "Test result"
BODY_PLAIN: |
Please find the attached test result report to the email.
ATTACHMENTS: 'index.html'

 

I see it recognizes the report path 

* What went wrong:Execution failed for task ':browserstackchromeTest'.> There were failing tests. See the report at: file:///opt/atlassian/pipelines/agent/build/config/geb/build/reports/browserstackchromeTest/tests/index.html

 

1 answer

1 accepted

0 votes
Answer accepted

Hi @Shubhendu Pandey ,

thank you for your feedback!

Try to provide full path to the index.html file instead of the filename only:

ATTACHMENTS: reports/browserstackchromeTest/tests/index.html

 

Hi @Oleksandr Kyrdan 

Thank you for your reply.

ATTACHMENTS: reports/browserstackchromeTest/tests/index.html

 Above is not working, I am getting the same error i.e "Failed to add an attachment. No such file index.html"

I also tried below things 

ATTACHMENTS: build/reports/browserstackchromeTest/tests/index.html
ATTACHMENTS: 'reports/browserstackchromeTest/tests/index.html'

But no luck so far 

Here is screenshot of error message 

screenshot17_39_20.png

-----------------------------------------------------------------------------------------------------------------------------------

Question:- Do I have to first create artifact in order to access this file?

@Shubhendu Pandey oh, you have two build directories in your path, then try:

ATTACHMENTS: config/geb/build/reports/browserstackchromeTest/tests/index.html

 
Note! /opt/atlassian/pipelines/agent/build/ is step's work directory.
Value stored in the variable BITBUCKET_CLONE_DIR.

@Oleksandr Kyrdan 

That worked 

Thank you! You are awesome.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,320 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you