Skip to content
This repository was archived by the owner on Nov 10, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/telegram-notifier/NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Notes
47 changes: 47 additions & 0 deletions plugins/telegram-notifier/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Telegram notify plugin

Telegram plugin which gives the opportunity send any messages to users via bot.

## Usage

```yaml
version: '1.0'
...
steps:
...
sendMessage:
image: codefresh/telegramnotifier
environment:
- TELEGRAM_TOKEN=TOKEN
- TELEGRAM_TO=99999999
- TELEGRAM_MESSAGE=Hello {{{userLink}}}, how are you
- TELEGRAM_IMAGES=https://codefresh.io/docs/assets/brand/codefresh-social.png
```

## Required variables

- `TELEGRAM_TOKEN` - token of your bot (cat get from [@BotFather](https://t.me/BotFather))
- `TELEGRAM_TO` - array of bot`s user id who will receive a message separated by comma (id you can retrieve from [@myidbot](https://t.me/myidbot))

## Optional variables

- `TELEGRAM_STATUS` - send info about current build, **if pass - all others variables will be ignored**
- `TELEGRAM_MESSAGE` - text of message which will be sent to user, with [Handlebars.js](https://github.com/wycats/handlebars.js/),
- available vars:
- `{{buildTrigger}}`
- `{{buildInitiator}}`
- `{{buildId}}`
- `{{buildTimestamp}}`
- `{{buildUrl}}`
- `{{repoOwner}}`
- `{{repoName}}`
- `{{branch}}`
- `{{revision}}`
- `{{commitAuthor}}`
- `{{commitUrl}}`
- `{{commitMessage}}`
- `{{userID}}` - id of current telegram user
- `{{{userLink}}}` - link to current telegram user

- for text markup use Markdown
- `TELEGRAM_IMAGES` - array of image links for attaching to message
25 changes: 25 additions & 0 deletions plugins/telegram-notifier/plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
image: codefresh/telegramnotifier
version: latest
description: Send message to telegram channel
keywords:
- telegram
home: https://github.com/codefresh-io/telegram-notifier
sources:
- https://github.com/codefresh-io/telegram-notifier
maintainers: # (optional)
- name: Andrii Shaforostov
email: andrii@codefresh.io
icon: https://upload.wikimedia.org/wikipedia/commons/5/5c/Telegram_Messenger.png
envs:
- name: TELEGRAM_TOKEN
type: required
description: token of your bot
- name: TELEGRAM_TO
type: required
description: array of user ids who will receive a message separated by comma
- name: TELEGRAM_STATUS
description: send info about current build
- name: TELEGRAM_MESSAGE
description: text of message which will be sent to user
- name: TELEGRAM_IMAGES
description: array of image links for attaching to message