Drone 0.8 version pipeline syntax
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
40
.drone.yml
40
.drone.yml
@@ -10,21 +10,25 @@ pipeline:
|
|||||||
|
|
||||||
prepare:
|
prepare:
|
||||||
image: alpine/git:latest
|
image: alpine/git:latest
|
||||||
environment:
|
|
||||||
DOCKER_HOST: tcp://docker:2375
|
|
||||||
commands:
|
commands:
|
||||||
- echo "Pipeline started for branch ${DRONE_BRANCH}"
|
- echo "🚀 Pipeline started for branch ${DRONE_BRANCH}"
|
||||||
- echo "Commit: ${DRONE_COMMIT_SHA}"
|
- echo "📝 Commit: ${DRONE_COMMIT_SHA:0:8}"
|
||||||
- echo "Author: ${DRONE_COMMIT_AUTHOR}"
|
- echo "👤 Author: ${DRONE_COMMIT_AUTHOR}"
|
||||||
|
- echo "📅 Build: ${DRONE_BUILD_NUMBER}"
|
||||||
- git --version
|
- git --version
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
image: python:3.12-slim
|
image: python:3.12-slim
|
||||||
commands:
|
commands:
|
||||||
|
- echo "🔍 Installing linting tools..."
|
||||||
- pip install --no-cache-dir flake8 black isort mypy
|
- pip install --no-cache-dir flake8 black isort mypy
|
||||||
|
- 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..."
|
||||||
- isort --check-only --diff src/ config/ tools/ tests/ || true
|
- 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
|
- flake8 src/ config/ tools/ tests/ --max-line-length=88 --extend-ignore=E203,W503 || true
|
||||||
|
- echo "✅ Linting completed"
|
||||||
|
|
||||||
test:
|
test:
|
||||||
image: python:3.12-slim
|
image: python:3.12-slim
|
||||||
@@ -52,9 +56,13 @@ pipeline:
|
|||||||
DOCKER_HOST: tcp://docker:2375
|
DOCKER_HOST: tcp://docker:2375
|
||||||
DOCKER_TLS_CERTDIR: ""
|
DOCKER_TLS_CERTDIR: ""
|
||||||
commands:
|
commands:
|
||||||
|
- echo "🐳 Docker version info:"
|
||||||
- docker version
|
- docker version
|
||||||
|
- echo "🔨 Building Docker image..."
|
||||||
- docker build -t quiz-bot:${DRONE_COMMIT_SHA} .
|
- docker build -t quiz-bot:${DRONE_COMMIT_SHA} .
|
||||||
- docker tag quiz-bot:${DRONE_COMMIT_SHA} quiz-bot:latest
|
- docker tag quiz-bot:${DRONE_COMMIT_SHA} quiz-bot:latest
|
||||||
|
- echo "📦 Docker build completed"
|
||||||
|
- docker images | grep quiz-bot
|
||||||
when:
|
when:
|
||||||
branch: [ main, develop ]
|
branch: [ main, develop ]
|
||||||
event: [ push, pull_request ]
|
event: [ push, pull_request ]
|
||||||
@@ -65,7 +73,10 @@ pipeline:
|
|||||||
DOCKER_HOST: tcp://docker:2375
|
DOCKER_HOST: tcp://docker:2375
|
||||||
DOCKER_TLS_CERTDIR: ""
|
DOCKER_TLS_CERTDIR: ""
|
||||||
commands:
|
commands:
|
||||||
- docker run --rm quiz-bot:${DRONE_COMMIT_SHA} python -c "import src.bot; print('Import successful')"
|
- echo "🧪 Testing Docker image..."
|
||||||
|
- docker run --rm quiz-bot:${DRONE_COMMIT_SHA} python -c "import src.bot; print('✅ Bot import successful')"
|
||||||
|
- docker run --rm quiz-bot:${DRONE_COMMIT_SHA} python -c "import config.config; print('✅ Config import successful')"
|
||||||
|
- echo "✅ Docker tests completed"
|
||||||
when:
|
when:
|
||||||
branch: [ main, develop ]
|
branch: [ main, develop ]
|
||||||
event: [ push, pull_request ]
|
event: [ push, pull_request ]
|
||||||
@@ -92,15 +103,24 @@ pipeline:
|
|||||||
notify_success:
|
notify_success:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
commands:
|
commands:
|
||||||
- echo "Pipeline completed for ${DRONE_BRANCH}"
|
- echo "🎉 Pipeline completed successfully!"
|
||||||
- echo "Build status: SUCCESS"
|
- echo "🌿 Branch: ${DRONE_BRANCH}"
|
||||||
|
- echo "📝 Commit: ${DRONE_COMMIT_SHA:0:8}"
|
||||||
|
- echo "🏗️ Build: #${DRONE_BUILD_NUMBER}"
|
||||||
|
- echo "✅ Status: SUCCESS"
|
||||||
|
- echo "🕒 Started: ${DRONE_BUILD_STARTED}"
|
||||||
when:
|
when:
|
||||||
status: success
|
status: success
|
||||||
|
|
||||||
notify_failure:
|
notify_failure:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
commands:
|
commands:
|
||||||
- echo "Pipeline completed for ${DRONE_BRANCH}"
|
- echo "❌ Pipeline failed!"
|
||||||
- echo "Build status: FAILURE"
|
- echo "🌿 Branch: ${DRONE_BRANCH}"
|
||||||
|
- echo "📝 Commit: ${DRONE_COMMIT_SHA:0:8}"
|
||||||
|
- echo "🏗️ Build: #${DRONE_BUILD_NUMBER}"
|
||||||
|
- echo "💥 Status: FAILURE"
|
||||||
|
- echo "🕒 Started: ${DRONE_BUILD_STARTED}"
|
||||||
|
- echo "🔍 Check logs above for details"
|
||||||
when:
|
when:
|
||||||
status: failure
|
status: failure
|
||||||
Reference in New Issue
Block a user