bitbucketbitbucket-pipelinesbitbucket-server

Bitbucket pipeline to build LaTex files and send via Mail


Hi try to find a solution to build a LaTeX document and send it afterwards via Mail:

image: dme26/latex-builder:latest
pipelines:
  default:
    - step:
       name: Build the .pdf
       script:
        - pdflatex --shell-escape LaTeX/MyDok.tex
       artifacts:
        - MyDok.pdf
    - step:
       name: Upload to Bitbucket Downloads
       script:
         - pipe: atlassian/bitbucket-upload-file:0.7.1
           variables:
             BITBUCKET_USERNAME: ???
             BITBUCKET_APP_PASSWORD: ???
             FILENAME: 'MyDok.pdf'
    - step:
       name: Send email
       script:
         - pipe: atlassian/email-notify:0.4.2
           variables:
             USERNAME: ???
             PASSWORD: ???
             FROM: myMail@gmail.com
             TO: myMail@icloud.com
             HOST: 'smtp.googlemail.com'
             ATTACHMENTS: MyDok.pdf, MyDok2.pdf

The first step is working! The MyDok.pdf is successful created.

The second step fails with the error message

āœ– API request failed with status 401. Check your username and app password and try again.

So my question is, what is expected here? My bitbucket username (alias e-mail) and my corresponding password? I'm quit sure that the solution was in the past to set $BITBUCKET_USERNAME & $BITBUCKET_APP_PASSWORD but these definitions seems to be outdated.

When this will work, what is then expected in the third step for USERNAME & PASSWORT? Are these my credentials for my gmail account? Can I store these data in a bitbucket APP Password, so that I don't need to store it in clear text?


Solution

  • I made it working with the help of the pipe documentation for atlassian/bitbucket-upload-file:0.7.1. You can find the reference here.

    The clue is, to create a dedicated APP PW in my gmail account and using these credentials.

    Open question is still how to attach more than one Attachment file. But this question is already ask in the Atlassian Community.