CI/CD build notifications
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-11-02 06:33:45 +09:00
parent d5f1809f5a
commit 01532e860a
10 changed files with 1104 additions and 42 deletions

View File

@@ -27,12 +27,12 @@ steps:
- name: docker
path: /var/run/docker.sock
commands:
- apk add --no-cache make curl git
- apk add --no-cache make curl git bash
- docker --version
- docker-compose --version
- echo "Repository:$${DRONE_REPO}"
- echo "Branch:$${DRONE_BRANCH}"
- echo "Commit:$${DRONE_COMMIT_SHA:0:8}"
- chmod +x scripts/ci/*.sh
# 2. Линтинг и проверка кода
- name: lint
@@ -178,8 +178,8 @@ steps:
event:
- push
# 10. Уведомления
- name: notify
# 10. Уведомления через Slack (если настроено)
- name: notify-slack
image: plugins/slack
settings:
webhook:
@@ -209,6 +209,34 @@ steps:
status:
- success
- failure
failure: ignore # Не падаем если Slack не настроен
# 11. Простые уведомления в логах
- name: notify-console
image: alpine:latest
commands:
- |
if [ "$${DRONE_BUILD_STATUS}" = "success" ]; then
echo "✅ BUILD SUCCESS!"
echo "📁 Repository: $${DRONE_REPO}"
echo "🌿 Branch: $${DRONE_BRANCH}"
echo "👤 Author: $${DRONE_COMMIT_AUTHOR}"
echo "📝 Commit: $${DRONE_COMMIT_SHA:0:8}"
echo "🕐 Duration: $$(date -d @$${DRONE_BUILD_STARTED} '+%H:%M:%S')"
else
echo "❌ BUILD FAILED!"
echo "📁 Repository: $${DRONE_REPO}"
echo "🌿 Branch: $${DRONE_BRANCH}"
echo "👤 Author: $${DRONE_COMMIT_AUTHOR}"
echo "📝 Commit: $${DRONE_COMMIT_SHA:0:8}"
fi
depends_on:
- deploy-production
- deploy-staging
when:
status:
- success
- failure
# Сервисы для тестирования
services:
@@ -233,44 +261,6 @@ volumes:
host:
path: /var/run/docker.sock
---
# Дополнительный пайплайн для нотификаций в Telegram
kind: pipeline
type: docker
name: telegram-notify
# Уведомления в Telegram
steps:
- name: telegram
image: appleboy/drone-telegram
settings:
token:
from_secret: telegram_token
to:
from_secret: telegram_chat_id
format: markdown
message: |
{{#success build.status}}
✅ *Build Success*
{{else}}
❌ *Build Failed*
{{/success}}
📁 *Repository:* {{repo.name}}
🌿 *Branch:* {{build.branch}}
👤 *Author:* {{build.author}}
📝 *Commit:* `{{truncate build.commit 8}}`
⏱️ *Duration:* {{since build.started}}
🔗 [View Build]({{build.link}})
trigger:
status:
- success
- failure
depends_on:
- catlink-ci
---
# Пайплайн для релизов
kind: pipeline