I am trying to add the email pipe to send out a notification (via outlook) when a build passes or fails but I keep running into an issue.
image: atlassian/default-image:3
pipelines:
default:
- step:
runs-on:
- self.hosted
- windows
name: 'Build and Test'
script:
#Build Project
- cmd.exe /c runprog.cmd
- step:
name: Notification
script:
- echo "Sending Status"
- pipe: atlassian/email-notify:0.7.0
variables:
USERNAME: jane@outlook.com
PASSWORD: $pass
FROM: $user
TO: $user
HOST: 'smtp-mail.outlook.com'
PORT: '587'
Error Message:Unable to find image 'bitbucketpipelines/email-notify:0.7.0' locally0.7.0: Pulling from bitbucketpipelines/email-notify214ca5fb9032: Pulling fs layerfa7d81b69b9a: Pulling fs layer2fd9be6893d2: Pulling fs layer7c8f45ffebd6: Pulling fs layerbd5d81492901: Pulling fs layer503c4e2633c0: Pulling fs layer52aeffd8d780: Pulling fs layer76cad53dd78c: Pulling fs layer8584b165b8ce: Pulling fs layer503c4e2633c0: Waiting52aeffd8d780: Waiting76cad53dd78c: Waiting7c8f45ffebd6: Waiting8584b165b8ce: Waitingbd5d81492901: Waitingfa7d81b69b9a: Download complete2fd9be6893d2: Verifying Checksum2fd9be6893d2: Download complete7c8f45ffebd6: Download complete214ca5fb9032: Verifying Checksum214ca5fb9032: Download complete503c4e2633c0: Verifying Checksum503c4e2633c0: Download complete76cad53dd78c: Verifying Checksum76cad53dd78c: Download complete52aeffd8d780: Verifying Checksum52aeffd8d780: Download complete8584b165b8ce: Verifying Checksum8584b165b8ce: Download complete214ca5fb9032: Pull completefa7d81b69b9a: Pull completebd5d81492901: Verifying Checksumbd5d81492901: Download complete2fd9be6893d2: Pull complete7c8f45ffebd6: Pull completebd5d81492901: Pull complete503c4e2633c0: Pull complete52aeffd8d780: Pull complete76cad53dd78c: Pull complete8584b165b8ce: Pull completeDigest: sha256:01b6a5aee203517ae808631d3f59e1725f9ad7c737a3604d184c307d6a3a9d91Status: Downloaded newer image for bitbucketpipelines/email-notify:0.7.0
Edit:
The debug helps! The error message I'm receiving is
✖ Failed to send email to victoria@google.com Check your configuration settings: (535, b'5.7.139 Authentication unsuccessful, basic authentication is disabled. [BL1PR13CA0365.namprd13.prod.outlook.com]') Any idea?Welcome to the community.
Based on my understanding, you'd like to send an email notification regardless if the step "Build and Test" is successful or failed.
If my understanding is correct, I believe your YAML configuration will only send a notification if the step "Build and Test" is successful as it will proceed to the next step but if it failed, it will not run the next step which is "Notification".
For this, I'd suggest using the configuration called after-script instead.
This will allow you to run scripts regardless of whether the step succeeds or fails.
Here's a sample step config:
- step:
runs-on:
- self.hosted
- windows
name: 'Build and Test'
script:
- cmd.exe /c runprog.cmd
after-script:
- echo "Sending Status"
#- Your Pipes script here (e.g. atlassian/email-notify:0.7.0)
Also for the error message, it is expected or normal to mention that the Docker image "bitbucketpipelines/email-notify:0.7.0" is not found as the step container will download/pull it later on.
Additionally, if you'd like to debug your Pipes script (atlassian/email-notify:0.7.0), you could also add the variable DEBUG: 'true' so you get more logs when you run it.
Hope it helps and let me know how it goes.
Regards,
Mark C
It won't let me post the error here but I've included the full error message (above in main question) I have gotten after debug do you know what may cause a 'basic authentication is disabled' error?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Based on the updated debug error message, it appears the SMTP server's basic authentication is disabled for the email you used in the Pipes script(atlassian/email-notify:0.7.0).
For this, you may want to check this with your email administrator/provider to ensure the SMTP server accepts basic authentication for the specific email.
Hope it helps and please do let me know if you have further questions that I can help with.
Regards,
Mark C
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.