Hi,
I need some guide implementing the bitbucket data send event. From the documentation it should be added to the script part, but I have few questions. From the implementation these are the properties:
ITLE: '<string>' # TEXT: '<string>' # Optional. # PRIORITY: '<string>' # Optional. # ALERT_TYPE: '<string>' # Optional. # TAGS: '<string>' # Optional. # DEBUG: '<boolean>' # Optional. # EU_ENDPOINT: '<boolean>' # Optional.
So how can datadog notify if a build fails?
Hi @Zuberu Abdulraman ,
Thank you for your question!
You can use $BITBUCKET_EXIT_CODE variable in the after-script section.
$BITBUCKET_EXIT_CODE - the exit code of a step, if step success value setup to 0.
script:
- <some build logic>
after-script:
- ALERT_TYPE="success"
- if [[ $BITBUCKET_EXIT_CODE -ne 0 ]]; then ALERT_TYPE="error" ; fi
- pipe: atlassian/datadog-send-event:1.1.2
variables:
API_KEY: $API_KEY
ALERT_TYPE: $ALERT_TYPE
Cheers,
Alex
Hi Alex,
Thanks for the information. I really appreciate that :) One more thing about TAGS, I was trying to use the ALERT TYPE as TAG but I was not successful. How can that be done?
So that incase its failure or success the alert will have tags.e.g of alert will be:
This is the title #status:error/success #branch:master #repository:aws #workspace:xxxxx%%% \n Alert sent from [Pipeline #60](https://bitbucket.org/xxxåxxxx/aws/addon/pipelines/home#!/results/60) \n %%%
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got this working with tags by defining 2 tags as variables. error and success. So that when failure the tag will be added to the log sent as tag.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.