Sign inSign up

e210/teams-notify

By e210

•Updated over 2 years ago

Bitbucket Pipelines Pipe: Teams Notify

Image
Integration & delivery
0

2.0K

e210/teams-notify repository overview

⁠Bitbucket Pipelines Pipe: TEAMS Notify

Sends a custom notification to Teams⁠.

You can configure Teams integration⁠ for your repository to get notifications on standard events, such as build failures and deployments. Use this pipe to send your own additional notifications at any point in your pipelines.

This project is based on the original Bitbucket repository slack-notify⁠ by Atlassian

⁠YAML Definition

Add the following snippet to the script section of your bitbucket-pipelines.yml file:

- pipe: e210/teams-notify:0.1.0
  variables:
    WEBHOOK_URL: '<string>'
    # MESSAGE: '<string>'  # Optional.
    # TITLE: '<string>'  # Optional.
    # PAYLOAD_FILE: '<string>' # Optional.
    # DEBUG: '<boolean>' # Optional.

⁠Variables

VariableUsage
WEBHOOK_URL (*)Incoming Webhook URL. It is recommended to use a secure repository variable.
MESSAGE (1)Notification attachment message. Required unless PAYLOAD_FILE is used.
TITLENotification pretext. Default: Notification sent from <a href='https://bitbucket.org'>Bitbucket</a>. Used with MESSAGE. Required unless PAYLOAD_FILE is used.
PAYLOAD_FILE(1)Path to JSON file containing custom payload. Required unless MESSAGE are used.
DEBUGTurn on extra debug information. Default: false.

(*) = required variable. (1) = required variable. Required one of the multiple options.

⁠Prerequisites

To send notifications to Team, you need an Incoming Webhook URL (Teams integration⁠).

⁠Examples

Basic example:

script:
  - pipe: e210/teams-notify:0.1.0
    variables:
      WEBHOOK_URL: $WEBHOOK_URL
      MESSAGE: 'Hello, world!'

Advanced example:

If you want to pass complex string with structure elements, use double quotes

script:
  - pipe: e210/teams-notify:0.1.0
    variables:
      WEBHOOK_URL: $WEBHOOK_URL
      MESSAGE: '"[${ENVIRONMENT_NAME}] build has exited with status $build_status"'

Use custom payload and modify payload with the envsubst⁠ program that substitutes the values of environment variables:

script:
  - envsubst < "payload.json.template" > "payload.json"
  - pipe: e210/teams-notify:0.1.0
    variables:
      WEBHOOK_URL: $WEBHOOK_URL
      PAYLOAD_FILE: payload.json

⁠Support

If you're reporting an issue, please include:

  • the version of the pipe
  • relevant logs and error messages
  • steps to reproduce

⁠License

Copyright (c) 2024 Ezio Caffi. Apache 2.0 licensed, see LICENSE.txt⁠ file.

For more information, visit the repository on Bitbucket⁠.

Tag summary

Content type

Image

Digest

sha256:122cd34c8…

Size

52.7 MB

Last updated

over 2 years ago

docker pull e210/teams-notify