I just wanted to extend my Bitbucket pipeline to send more than one attachment via Mail. For this I use the following .yml file:
image: dme26/latex-builder:latest
pipelines:
default:
- step:
name: Build the .pdf
script:
- cd LaTeX
- pdflatex Installation-Plan.tex
- pdflatex Installation-Plan.tex
artifacts:
- LaTeX/Installation-Plan.pdf
- Data/data.csv
- step:
name: Upload to Bitbucket Downloads
script:
- pipe: atlassian/bitbucket-upload-file:0.7.1
variables:
BITBUCKET_USERNAME: '$BITBUCKET_USERNAME'
BITBUCKET_APP_PASSWORD: '$BITBUCKET_APP_PASSWORD'
FILENAME: 'LaTeX/Installation-Plan.pdf'
- pipe: atlassian/bitbucket-upload-file:0.7.1
variables:
BITBUCKET_USERNAME: '$BITBUCKET_USERNAME'
BITBUCKET_APP_PASSWORD: '$BITBUCKET_APP_PASSWORD'
FILENAME: 'Data/data.csv'
- step:
name: Send email
script:
- MY_DATE=${MY_DATE:-$(date +%Y-%m-%d)}
- pipe: atlassian/email-notify:0.13.1
variables:
USERNAME: '$GMAIL_MAIL'
PASSWORD: '$GMAIL_APP_PASSWORD'
FROM: smtp.my@gmail.com
TO: 'myMail@icloud.com, mySecondMail@web.de'
HOST: 'smtp.gmail.com'
PORT: 587
SUBJECT: '$MY_DATE Installation-Plan'
ATTACHMENTS: 'LaTeX/Installation-Plan.pdf,Data/data.csv'
script: - pipe: atlassian/email-notify:0.13.1 variables: USERNAME: 'myemail@example.com' PASSWORD: $PASSWORD FROM: 'myemail@example.com' TO: 'example@example.com' HOST: 'smtp.gmail.com' ATTACHMENTS: 'file1.txt,file2.txt'
In my in inbox I see this:
So two attachments are mentioned, but only the file „data.csv“ is attached.
@pascal_schroeer hi. I used this pipe by myself and see the two files.
Regards, Igor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm for me it is not working. I tried also different mail addresses, but still the same issue...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@pascal_schroeer . Maybe you have problems with the second file. Try to attach only problem file to exclude this reason.
Regards, Igor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Igor Stoyanov Alteady done… I switched the two files in the attachment statement. This results in sending me the other file… this is why I thought it must be a syntax error…
Can you maybe give me a minimal working example for zip’ping these files before sending? At least then it should be fixed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@pascal_schroeer i do not know what is inside you image exactly, so some general idea:
Inside this step
- step:
name: Build the .pdf
script:
<install zip if not present i.e apt-get install zip.
Depends on your image>
- cd LaTeX
- pdflatex Installation-Plan.tex
- pdflatex Installation-Plan.tex
< seems like here you created a files.
So zip them: zip <options> <zip file> <source file>>
artifacts:
- <your zip files>
And then use zipped files with the pipes below.
More details how to zip.
Regards, Igor
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.