Skip to content
Snippets Groups Projects
Commit 768586e1 authored by Dmitriy Safronov's avatar Dmitriy Safronov
Browse files

message

parent f7cb4341
No related branches found
No related tags found
No related merge requests found
......@@ -17,12 +17,13 @@ stages:
name: $CURL_IMAGE
entrypoint: ["/usr/bin/env", "sh", "-c"]
script: |
test -n "${CI_COMMIT_TAG}" && NOTIFICATION_REVISION=${CI_COMMIT_TAG} || NOTIFICATION_REVISION=${CI_COMMIT_SHA}
NOTIFICATION_REVISION="${CI_COMMIT_SHA}"
test -z "${CI_COMMIT_TAG}" || NOTIFICATION_REVISION="$(echo ${CI_COMMIT_TAG} | sed -e 's/\./\\\\./g')"
curl \
-X POST \
-H "Content-Type: application/json" \
-d "{\"chat_id\": \"${TELEGRAM_RECEPIENT}\", \"parse_mode\": \"html\", \"text\": \"${NOTIFICATION_ICON} <a href="${CI_PROJECT_URL}"><b>${CI_PROJECT_TITLE}</b></a> <br>CI/CD pipeline run <a href="${CI_PIPELINE_URL}"><b>${NOTIFICATION_TYPE}</b></a> <br> - <b>revision</b>: \"}" \
https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage
-d "{\"chat_id\": \"${TELEGRAM_RECEPIENT}\", \"parse_mode\": \"MarkdownV2\", \"disable_web_page_preview\": \"true\", \"text\": \"${NOTIFICATION_ICON} [*${CI_PROJECT_TITLE}*](${CI_PROJECT_URL})\nCI/CD pipeline run [*${NOTIFICATION_TYPE}*](${CI_PIPELINE_URL})\n\\\\- *revision*: ${NOTIFICATION_REVISION}\"}" \
"https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage"
cache: []
dependencies: []
interruptible: false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment