mirror of
https://github.com/tektoncd/catalog.git
synced 2024-11-29 06:34:08 +00:00
a7f32f5f65
Changes include: - adds version label - adds a minimum pipeline versions supported by the task - adds tags for task - modified description to add a summary This patch moves the telegrammessage files to the task directory and renames the directory - The directory name is changed to match the resource name - Modifies the path for install task command in readme file Issue: #386 Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com> |
||
---|---|---|
.. | ||
README.md | ||
send-to-telegram.yaml |
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://raw.githubusercontent.com/tektoncd/catalog/master/task/send-to-telegram/0.1/send-to-telegram.yaml
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.
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