This commit is contained in:
19
.drone.yml
19
.drone.yml
@@ -3,14 +3,12 @@ kind: pipeline
|
|||||||
type: docker
|
type: docker
|
||||||
name: code-quality
|
name: code-quality
|
||||||
|
|
||||||
# Триггеры для пайплайна проверки качества
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Проверка качества Python кода (только критические ошибки)
|
|
||||||
- name: python-lint
|
- name: python-lint
|
||||||
image: python:3.11-slim
|
image: python:3.11-slim
|
||||||
commands:
|
commands:
|
||||||
@@ -20,7 +18,6 @@ steps:
|
|||||||
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||||
- echo "✅ Critical checks passed"
|
- echo "✅ Critical checks passed"
|
||||||
|
|
||||||
# Проверка качества JavaScript/React кода (опционально)
|
|
||||||
- name: frontend-lint
|
- name: frontend-lint
|
||||||
image: node:18-alpine
|
image: node:18-alpine
|
||||||
commands:
|
commands:
|
||||||
@@ -30,7 +27,6 @@ steps:
|
|||||||
- npm run lint || echo "⚠️ ESLint warnings found (non-blocking)"
|
- npm run lint || echo "⚠️ ESLint warnings found (non-blocking)"
|
||||||
- echo "✅ Frontend checks completed"
|
- echo "✅ Frontend checks completed"
|
||||||
|
|
||||||
# Проверка безопасности зависимостей Python (опционально)
|
|
||||||
- name: python-security
|
- name: python-security
|
||||||
image: python:3.11-slim
|
image: python:3.11-slim
|
||||||
commands:
|
commands:
|
||||||
@@ -40,7 +36,6 @@ steps:
|
|||||||
- safety check --file=requirements.txt --exit-zero || echo "⚠️ Security warnings found (non-blocking)"
|
- safety check --file=requirements.txt --exit-zero || echo "⚠️ Security warnings found (non-blocking)"
|
||||||
- echo "✅ Security checks completed"
|
- echo "✅ Security checks completed"
|
||||||
|
|
||||||
# Проверка безопасности зависимостей Node.js
|
|
||||||
- name: frontend-security
|
- name: frontend-security
|
||||||
image: node:18-alpine
|
image: node:18-alpine
|
||||||
commands:
|
commands:
|
||||||
@@ -54,7 +49,6 @@ kind: pipeline
|
|||||||
type: docker
|
type: docker
|
||||||
name: build-and-publish
|
name: build-and-publish
|
||||||
|
|
||||||
# Триггеры для пайплайна сборки
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
@@ -64,12 +58,10 @@ trigger:
|
|||||||
- master
|
- master
|
||||||
- develop
|
- develop
|
||||||
|
|
||||||
# Зависимость от пайплайна проверки качества
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- code-quality
|
- code-quality
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Сборка и публикация Docker образа
|
|
||||||
- name: build-and-push
|
- name: build-and-push
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
@@ -77,7 +69,7 @@ steps:
|
|||||||
repo: registry.nevetime.ru/mc-panel
|
repo: registry.nevetime.ru/mc-panel
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- "${DRONE_COMMIT_SHA:0:8}"
|
- ${DRONE_COMMIT_SHA:0:8}
|
||||||
auto_tag: true
|
auto_tag: true
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
context: .
|
context: .
|
||||||
@@ -86,21 +78,20 @@ steps:
|
|||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
build_args:
|
build_args:
|
||||||
- "BUILD_DATE=${DRONE_BUILD_CREATED}"
|
- BUILD_DATE=${DRONE_BUILD_CREATED}
|
||||||
- "VCS_REF=${DRONE_COMMIT_SHA}"
|
- VCS_REF=${DRONE_COMMIT_SHA}
|
||||||
- "VERSION=1.1.0"
|
- VERSION=1.1.0
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
- tag
|
- tag
|
||||||
|
|
||||||
# Сканирование образа на уязвимости (опционально, требует авторизации)
|
|
||||||
- name: scan-image
|
- name: scan-image
|
||||||
image: aquasec/trivy
|
image: aquasec/trivy
|
||||||
commands:
|
commands:
|
||||||
- echo "⚠️ Image scanning skipped (requires registry authentication)"
|
- echo "⚠️ Image scanning skipped (requires registry authentication)"
|
||||||
- echo "To enable scanning, configure registry credentials for Trivy"
|
- echo "To enable scanning, configure registry credentials for Trivy"
|
||||||
- echo "Image published: registry.nevetime.ru/mc-panel:${DRONE_COMMIT_SHA:0:8}"
|
- echo "Image published registry.nevetime.ru/mc-panel"
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
|||||||
Reference in New Issue
Block a user