emoji-freeecho "Проверка на наличие эмоджи в .drone.yml:" && \
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
grep -n "🔧\|🚀\|📝\|👤\|📅\|✅\|🔍\|🎨\|📦\|🧪\|🔒\|🛡️\|🐳\|🔨\|📊\|📈\|📋\|🌿\|🏗️\|🎉" .drone.yml || echo "✅ Эмоджи не найдены" && \ echo "" && \ echo "Размер файла:" && \ wc -l .drone.yml && \ echo "" && \ echo "Первые несколько строк:" && \ head -10 .drone.yml emoji-free
This commit is contained in:
68
.drone.yml
68
.drone.yml
@@ -6,54 +6,54 @@ steps:
|
|||||||
- name: install-deps
|
- name: install-deps
|
||||||
image: python:3.12-slim
|
image: python:3.12-slim
|
||||||
commands:
|
commands:
|
||||||
- echo "🔧 Installing dependencies..."
|
- echo "Installing dependencies..."
|
||||||
- pip install --upgrade pip
|
- pip install --upgrade pip
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
- echo "✅ Dependencies installed"
|
- echo "Dependencies installed"
|
||||||
|
|
||||||
- name: prepare
|
- name: prepare
|
||||||
image: alpine/git:latest
|
image: alpine/git:latest
|
||||||
commands:
|
commands:
|
||||||
- echo "🚀 Pipeline started for branch ${DRONE_BRANCH}"
|
- echo "Pipeline started for branch ${DRONE_BRANCH}"
|
||||||
- echo "📝 Commit: $(echo ${DRONE_COMMIT_SHA} | cut -c1-8)"
|
- echo "Commit: $(echo ${DRONE_COMMIT_SHA} | cut -c1-8)"
|
||||||
- echo "👤 Author: ${DRONE_COMMIT_AUTHOR}"
|
- echo "Author: ${DRONE_COMMIT_AUTHOR}"
|
||||||
- echo "📅 Build: ${DRONE_BUILD_NUMBER}"
|
- echo "Build: ${DRONE_BUILD_NUMBER}"
|
||||||
- git --version
|
- git --version
|
||||||
|
|
||||||
- name: lint
|
- name: lint
|
||||||
image: python:3.12-slim
|
image: python:3.12-slim
|
||||||
commands:
|
commands:
|
||||||
- echo "🔍 Installing linting tools..."
|
- echo "Installing linting tools..."
|
||||||
- pip install flake8 black isort
|
- pip install flake8 black isort
|
||||||
- echo "🎨 Running Black formatter check..."
|
- echo "Running Black formatter check..."
|
||||||
- black --check --diff src/ config/ tools/ tests/ || true
|
- black --check --diff src/ config/ tools/ tests/ || true
|
||||||
- echo "📦 Running isort import sorting check..."
|
- echo "Running isort import sorting check..."
|
||||||
- isort --check-only --diff src/ config/ tools/ tests/ || true
|
- isort --check-only --diff src/ config/ tools/ tests/ || true
|
||||||
- echo "🔧 Running flake8 linting..."
|
- echo "Running flake8 linting..."
|
||||||
- flake8 src/ config/ tools/ tests/ --max-line-length=88 --extend-ignore=E203,W503 || true
|
- flake8 src/ config/ tools/ tests/ --max-line-length=88 --extend-ignore=E203,W503 || true
|
||||||
- echo "✅ Linting completed"
|
- echo "Linting completed"
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
image: python:3.12-slim
|
image: python:3.12-slim
|
||||||
commands:
|
commands:
|
||||||
- echo "🧪 Installing test dependencies..."
|
- echo "Installing test dependencies..."
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
- pip install pytest
|
- pip install pytest
|
||||||
- echo "🚀 Running tests..."
|
- echo "Running tests..."
|
||||||
- python -m pytest tests/ -v --tb=short || true
|
- python -m pytest tests/ -v --tb=short || true
|
||||||
- python tests/test_bot.py || true
|
- python tests/test_bot.py || true
|
||||||
- echo "✅ Tests completed"
|
- echo "Tests completed"
|
||||||
|
|
||||||
- name: security
|
- name: security
|
||||||
image: python:3.12-slim
|
image: python:3.12-slim
|
||||||
commands:
|
commands:
|
||||||
- echo "🔒 Installing security tools..."
|
- echo "Installing security tools..."
|
||||||
- pip install safety bandit
|
- pip install safety bandit
|
||||||
- echo "🛡️ Running safety check..."
|
- echo "Running safety check..."
|
||||||
- safety check --json || true
|
- safety check --json || true
|
||||||
- echo "🔍 Running bandit security check..."
|
- echo "Running bandit security check..."
|
||||||
- bandit -r src/ -f json || true
|
- bandit -r src/ -f json || true
|
||||||
- echo "✅ Security checks completed"
|
- echo "Security checks completed"
|
||||||
|
|
||||||
- name: docker-build
|
- name: docker-build
|
||||||
image: docker:dind
|
image: docker:dind
|
||||||
@@ -61,12 +61,12 @@ steps:
|
|||||||
- name: dockersock
|
- name: dockersock
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
commands:
|
commands:
|
||||||
- echo "🐳 Docker version info:"
|
- echo "Docker version info:"
|
||||||
- docker version
|
- docker version
|
||||||
- echo "🔨 Building Docker image..."
|
- echo "Building Docker image..."
|
||||||
- docker build -t ${DRONE_REPO_NAME}:latest .
|
- docker build -t ${DRONE_REPO_NAME}:latest .
|
||||||
- docker tag ${DRONE_REPO_NAME}:latest quiz-bot:${DRONE_COMMIT_SHA}
|
- docker tag ${DRONE_REPO_NAME}:latest quiz-bot:${DRONE_COMMIT_SHA}
|
||||||
- echo "📦 Docker build completed"
|
- echo "Docker build completed"
|
||||||
- docker images | grep -E "${DRONE_REPO_NAME}|quiz-bot" || true
|
- docker images | grep -E "${DRONE_REPO_NAME}|quiz-bot" || true
|
||||||
|
|
||||||
- name: docker-test
|
- name: docker-test
|
||||||
@@ -75,30 +75,30 @@ steps:
|
|||||||
- name: dockersock
|
- name: dockersock
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
commands:
|
commands:
|
||||||
- echo "🧪 Testing Docker image..."
|
- echo "Testing Docker image..."
|
||||||
- docker run --rm ${DRONE_REPO_NAME}:latest python -c "import src.bot; print('✅ Bot import successful')" || true
|
- docker run --rm ${DRONE_REPO_NAME}:latest python -c "import src.bot; print('Bot import successful')" || true
|
||||||
- docker run --rm ${DRONE_REPO_NAME}:latest python -c "import config.config; print('✅ Config import successful')" || true
|
- docker run --rm ${DRONE_REPO_NAME}:latest python -c "import config.config; print('Config import successful')" || true
|
||||||
- echo "✅ Docker tests completed"
|
- echo "Docker tests completed"
|
||||||
|
|
||||||
- name: quality
|
- name: quality
|
||||||
image: python:3.12-slim
|
image: python:3.12-slim
|
||||||
commands:
|
commands:
|
||||||
- echo "📊 Installing quality tools..."
|
- echo "Installing quality tools..."
|
||||||
- pip install flake8 radon
|
- pip install flake8 radon
|
||||||
- echo "📈 Calculating code metrics..."
|
- echo "Calculating code metrics..."
|
||||||
- radon cc src/ -s || true
|
- radon cc src/ -s || true
|
||||||
- radon mi src/ -s || true
|
- radon mi src/ -s || true
|
||||||
- echo "✅ Quality check completed"
|
- echo "Quality check completed"
|
||||||
|
|
||||||
- name: notify
|
- name: notify
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
commands:
|
commands:
|
||||||
- echo "📋 Pipeline Summary:"
|
- echo "Pipeline Summary:"
|
||||||
- echo "🌿 Branch: ${DRONE_BRANCH}"
|
- echo "Branch: ${DRONE_BRANCH}"
|
||||||
- echo "📝 Commit: $(echo ${DRONE_COMMIT_SHA} | cut -c1-8)"
|
- echo "Commit: $(echo ${DRONE_COMMIT_SHA} | cut -c1-8)"
|
||||||
- echo "🏗️ Build: #${DRONE_BUILD_NUMBER}"
|
- echo "Build: #${DRONE_BUILD_NUMBER}"
|
||||||
- echo "👤 Author: ${DRONE_COMMIT_AUTHOR}"
|
- echo "Author: ${DRONE_COMMIT_AUTHOR}"
|
||||||
- echo "🎉 Quiz Bot CI Pipeline completed!"
|
- echo "Quiz Bot CI Pipeline completed!"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: dockersock
|
- name: dockersock
|
||||||
|
|||||||
Reference in New Issue
Block a user