From 35fa39720cff9e9763f624d17bef004cf14e567a Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Sun, 26 Feb 2023 10:26:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=83=D0=B2=D0=B5=D0=B4=D0=BE=D0=BC=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BE=20=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 3 ++- ci-notify.sh | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6204cf8..5d779a7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -137,6 +137,7 @@ steps: - git checkout $DRONE_COMMIT - cd documentation/ru - mike deploy --prefix gitlab-notification/ru --branch docs-deploy --push --update-aliases develop + - sh ci-notify.sh image_pull_secrets: - DOCKER_AUTH @@ -193,6 +194,6 @@ volumes: path: /drone/volume/mkdocs_cache/gitlab_notification --- kind: signature -hmac: 23d498c2e305f04c5aef8df6c48fa62ab96def09d238c703497a3d2955526b67 +hmac: 0ec61b15fedee05ddb1c602fae1893c68ab292e2df8424ef36f8e9a94faf707e ... diff --git a/ci-notify.sh b/ci-notify.sh index 43fbb31..4d7f090 100644 --- a/ci-notify.sh +++ b/ci-notify.sh @@ -1,7 +1,13 @@ #!/bin/bash -TIME="10" -URL="https://api.telegram.org/bot$DEPLOY_TELEGRAM_BOT_TOKEN/sendMessage" -TEXT="Deploy status: $1%0A-- -- -- -- --%0ABranch:+$CI_COMMIT_REF_SLUG%0AProject:+$CI_PROJECT_TITLE" +if [ "$DRONE_BUILD_STATUS" = "success" ]; then + DEPLOY_STATUS="✅" +else + DEPLOY_STATUS="❌" +fi -curl -s --max-time $TIME --proxy $PROXY_SETTING -d "chat_id=$TELEGRAM_CHAT_ID&disable_web_page_preview=1&text=$TEXT" $URL >/dev/null +TIME="10" +URL="https://api.telegram.org/bot$NOTIFY_TELEGRAM_BOT_TOKEN/sendMessage" +TEXT="Deploy status: $DEPLOY_STATUS%0A-- -- -- -- --%0ABranch:+$DRONE_TARGET_BRANCH%0ATag:+$DRONE_TAG%0AProject:+$DRONE_REPO_NAME" + +curl -s --max-time $TIME -d "chat_id=$NOTIFY_TELEGRAM_CHAT_ID&disable_web_page_preview=1&text=$TEXT" $URL >/dev/null