Hello @Depstan Thankachan Xavier ,
Thank you for reaching out to Atlassian Community!
The ATTACHMENTS attribute in the pipe expects a fixed file name, and it will not expand the filenames to match a pattern like *.html.
In this case, I would suggest compressing the files in a .zip - where this compressed file would have a fixed name - and then adding the zip file as the attachment.
Following is an example of using the zip command to compress all the *.html files within the test-results folder in a zip file named my_html_files.zip :
- zip my_html_files.zip test-results/*.html
If the zip command is not available (command not found) in the docker image you are using, you will need to install it using the following command :
- apt-get update && apt-get install -y zip
Then, in the pipe's ATTACHMENTS attribute, you can specify the name of the compressed file which will be a fixed name. The complete YAML step would look like below :
- apt-get update && apt-get install -y zip #only necessary if the image does not have zip
- zip my_html_files.zip test-results/*.html
- pipe: atlassian/email-notify:0.8.0
variables:
SUBJECT: '${ALERT_TYPE}:Bitbucket Pipe Notification for ${BITBUCKET_BRANCH}: Build ${BITBUCKET_BUILD_NUMBER}'
ATTACHMENTS: "my_html_files.zip"
Hope that helps! Let me know in case you have any questions.
Thank you, @Depstan Thankachan Xavier !
Patrik S
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.