Fixed drone.yml

This commit is contained in:
2026-01-15 20:57:51 +06:00
parent 1985a25ea8
commit 6d80ef7200
9 changed files with 5509 additions and 101 deletions

View File

@@ -10,44 +10,35 @@ trigger:
- pull_request
steps:
# Проверка качества Python кода
# Проверка качества Python кода (только критические ошибки)
- name: python-lint
image: python:3.11-slim
commands:
- cd backend
- pip install flake8 pylint black isort
- echo "Running flake8..."
- pip install flake8
- echo "Running flake8 (critical errors only)..."
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- echo "Running pylint..."
- pylint **/*.py --exit-zero --max-line-length=127
- echo "Checking code formatting with black..."
- black --check --diff .
- echo "Checking imports with isort..."
- isort --check-only --diff .
- echo "✅ Critical checks passed"
# Проверка качества JavaScript/React кода
# Проверка качества JavaScript/React кода (опционально)
- name: frontend-lint
image: node:18-alpine
commands:
- cd frontend
- npm ci
- echo "Running ESLint..."
- npm run lint || true
- echo "Checking code formatting..."
- npx prettier --check "src/**/*.{js,jsx,ts,tsx,json,css,md}" || true
- echo "Running ESLint (non-blocking)..."
- npm run lint || echo "⚠️ ESLint warnings found (non-blocking)"
- echo "✅ Frontend checks completed"
# Проверка безопасности зависимостей Python
# Проверка безопасности зависимостей Python (опционально)
- name: python-security
image: python:3.11-slim
commands:
- cd backend
- pip install safety bandit
- pip install safety
- echo "Checking for known security vulnerabilities..."
- safety check --file=requirements.txt --exit-zero
- echo "Running bandit security linter..."
- bandit -r . -f json -o bandit-report.json --exit-zero || true
- bandit -r . --exit-zero
- safety check --file=requirements.txt --exit-zero || echo "⚠️ Security warnings found (non-blocking)"
- echo "✅ Security checks completed"
# Проверка безопасности зависимостей Node.js
- name: frontend-security
@@ -82,9 +73,9 @@ steps:
- name: build-and-push
image: plugins/docker
settings:
# Настройки реестра (замените на свои)
registry: registry.example.com
repo: registry.example.com/mc-panel
# Настройки реестра
registry: registry.nevetime.ru
repo: registry.nevetime.ru/mc-panel
# Теги для образа
tags:
@@ -121,7 +112,7 @@ steps:
- name: scan-image
image: aquasec/trivy
commands:
- trivy image --exit-code 0 --severity HIGH,CRITICAL registry.example.com/mc-panel:${DRONE_COMMIT_SHA:0:8}
- trivy image --exit-code 0 --severity HIGH,CRITICAL registry.nevetime.ru/mc-panel:${DRONE_COMMIT_SHA:0:8}
when:
event:
- push