1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-21 05:55:35 +00:00
catalog/task/send-to-telegram/0.1
Quan Zhang e294e1246b [TEP-0110] Update Tekton Catalog installation instructions
Prior to this change, the installation instructions directly use the resource urls in the Catalog repo, which results in tight coupling between the organization and how users fetch resources (as described in TEP-0110). This commit updates the installation guide to install Tekton Catalog resources via Tekton Hub Api: https://github.com/tektoncd/hub/pull/539

This change decouples the Tekton Catalog organization from resouces resolution, which enables Tekton Catalog reorganization.
2022-08-16 16:25:52 +01:00
..
README.md [TEP-0110] Update Tekton Catalog installation instructions 2022-08-16 16:25:52 +01:00
send-to-telegram.yaml Add platforms annotation to send-to-* tasks 2021-08-31 07:43:14 +01:00

Post a message to telegram

These tasks post a simple message to a telegram chat.

send-to-telegram

This task uses the Bot API of telegram to send a message. Create a bot as decribed over here.

Install the Task and create a secret

kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/send-to-telegram/0.1/raw

Create a secret that has bot token.

Example telegram-bot-token-secret.yaml

kind: Secret
apiVersion: v1
metadata:
  name: telegram-bot-token-secret
stringData:
  token: {token over here}

Example kubectl command

kubectl apply -f telegram-bot-token-secret.yaml

Parameters

  • bot-token-secret: The name of the secret that has the bot token.

  • message: Plain text message to be posted in the chat.

  • chat-id: The ID of the chat to send the message towards. See telegram documentation to get the correct ID.

Platforms

The Task can be run on linux/amd64, linux/s390x and linux/ppc64le platforms.

Usage

This TaskRun runs the Task to post a message to the the chat channel.

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: run-send-to-telegram
spec:
  params:
  - name: bot-token-secret
    value: telegram-bot-token-secret
  - name: message
    value: "Hello from Tekton!"
  - name: chat-id
    value: "<your chat ID over here>"
  taskRef:
    name: send-to-telegram