Merge pull request 'devops' (#2) from devops into main
Some checks failed
continuous-integration/drone/push Build is failing

Reviewed-on: #2
This commit is contained in:
2025-09-11 02:56:20 +00:00
3 changed files with 25 additions and 57 deletions

View File

@@ -1,6 +1,6 @@
kind: pipeline kind: pipeline
type: docker type: docker
name: quiz-bot-ci-cd name: multibot-ci
trigger: trigger:
branch: branch:
@@ -11,67 +11,33 @@ trigger:
- push - push
- pull_request - pull_request
services:
- name: docker
image: docker:27-dind
privileged: true
command:
- --host=tcp://0.0.0.0:2375
environment:
DOCKER_TLS_CERTDIR: ""
steps: steps:
- name: prepare - name: install-deps
image: alpine/git:latest image: python:3.11-slim
environment:
DOCKER_HOST: tcp://docker:2375
commands: commands:
- echo "🚀 Pipeline started for branch ${DRONE_BRANCH}" - pip install --upgrade pip
# BusyBox ash может не поддерживать ${VAR:0:8}; безопаснее так: - pip install -r requirements.txt
- echo "📝 Commit: $(echo ${DRONE_COMMIT_SHA} | cut -c1-8)"
- echo "👤 Author: ${DRONE_COMMIT_AUTHOR}"
- echo "📅 Build: ${DRONE_BUILD_NUMBER}"
- git --version
- name: lint - name: lint
image: python:3.12-slim image: python:3.11-slim
commands: commands:
- echo "🔍 Installing linting tools..." - pip install flake8
- pip install --no-cache-dir flake8 black isort mypy - flake8 .
- echo "🎨 Running Black formatter check..."
- black --check --diff src/ config/ tools/ tests/ || true
- echo "📦 Running isort import sorting check..."
- isort --check-only --diff src/ config/ tools/ tests/ || true
- echo "🔧 Running flake8 linting..."
- flake8 src/ config/ tools/ tests/ --max-line-length=88 --extend-ignore=E203,W503 || true
- echo "✅ Linting completed"
- name: test - name: docker-build
image: python:3.12-slim image: plugins/docker:27
commands: settings:
- pip install --no-cache-dir -r requirements.txt repo: ${DRONE_REPO} # или ${DRONE_REPO_NAMESPACE}/${DRONE_REPO_NAME}
- python -m pytest tests/ -v --tb=short || true tags:
- python tests/test_bot.py || true - latest
- ${DRONE_COMMIT_SHA}
dockerfile: Dockerfile
# Если не хочешь пушить — добавь:
# dry_run: true
- name: security - name: docker-test
image: python:3.12-slim
commands:
- pip install --no-cache-dir safety bandit
- safety check --json || true
- bandit -r src/ -f json || true
- name: typecheck
image: python:3.12-slim
commands:
- pip install --no-cache-dir mypy types-requests
- mypy src/ --ignore-missing-imports || true
- name: docker_build
image: docker:27-cli image: docker:27-cli
environment:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
commands: commands:
- echo "🐳 Docker version info:" - docker run --rm ${DRONE_REPO_NAME}:${DRONE_COMMIT_SHA} python -c "print('image ok')"
- docker version depends_on:
- echo "🔨 Building Docker image..." - docker-build

View File

@@ -46,7 +46,9 @@ quiz_test/
- 📖 [Быстрый старт](docs/QUICKSTART.md) - Начало работы с проектом - 📖 [Быстрый старт](docs/QUICKSTART.md) - Начало работы с проектом
- 🐳 [Docker инструкции](docs/DOCKER_README.md) - Контейнеризация и развертывание - 🐳 [Docker инструкции](docs/DOCKER_README.md) - Контейнеризация и развертывание
- 🏗️ [DevOps инфраструктура](docs/DEVOPS_SUMMARY.md) - CI/CD и автоматизация - 🏗️ [DevOps инфраструктура](docs/DEVOPS_SUMMARY.md) - CI/CD и автоматизация
- 🔧 [Инфраструктура](docs/INFRASTRUCTURE.md) - Архитектура и компоненты - <EFBFBD> [Drone 1.x+ конфигурация](docs/DRONE_1.x_CONFIG.md) - Современный CI/CD pipeline
- 🔄 [Миграция Drone 0.8](docs/DRONE_0.8_MIGRATION.md) - Переход с устаревшей версии
- <20>🔧 [Инфраструктура](docs/INFRASTRUCTURE.md) - Архитектура и компоненты
- 🔧 [Отчет по исправлениям](docs/FIX_REPORT.md) - История изменений - 🔧 [Отчет по исправлениям](docs/FIX_REPORT.md) - История изменений
## 🚀 Быстрый старт ## 🚀 Быстрый старт

Binary file not shown.