From 03ef404ba3f16a65bead3335d9a3dfcc6f47d4c7 Mon Sep 17 00:00:00 2001 From: "Andrey K. Choi" Date: Thu, 11 Sep 2025 08:36:35 +0900 Subject: [PATCH] Drone 0.8 version pipeline syntax --- .drone.yml | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7a55d91..98e4dbc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,21 +10,25 @@ pipeline: prepare: image: alpine/git:latest - environment: - DOCKER_HOST: tcp://docker:2375 commands: - - echo "Pipeline started for branch ${DRONE_BRANCH}" - - echo "Commit: ${DRONE_COMMIT_SHA}" - - echo "Author: ${DRONE_COMMIT_AUTHOR}" + - echo "๐Ÿš€ Pipeline started for branch ${DRONE_BRANCH}" + - echo "๐Ÿ“ Commit: ${DRONE_COMMIT_SHA:0:8}" + - echo "๐Ÿ‘ค Author: ${DRONE_COMMIT_AUTHOR}" + - echo "๐Ÿ“… Build: ${DRONE_BUILD_NUMBER}" - git --version lint: image: python:3.12-slim commands: + - echo "๐Ÿ” Installing linting tools..." - pip install --no-cache-dir flake8 black isort mypy + - 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" test: image: python:3.12-slim @@ -52,9 +56,13 @@ pipeline: DOCKER_HOST: tcp://docker:2375 DOCKER_TLS_CERTDIR: "" commands: + - echo "๐Ÿณ Docker version info:" - docker version + - echo "๐Ÿ”จ Building Docker image..." - docker build -t quiz-bot:${DRONE_COMMIT_SHA} . - docker tag quiz-bot:${DRONE_COMMIT_SHA} quiz-bot:latest + - echo "๐Ÿ“ฆ Docker build completed" + - docker images | grep quiz-bot when: branch: [ main, develop ] event: [ push, pull_request ] @@ -65,7 +73,10 @@ pipeline: DOCKER_HOST: tcp://docker:2375 DOCKER_TLS_CERTDIR: "" 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: branch: [ main, develop ] event: [ push, pull_request ] @@ -92,15 +103,24 @@ pipeline: notify_success: image: alpine:latest commands: - - echo "Pipeline completed for ${DRONE_BRANCH}" - - echo "Build status: SUCCESS" + - echo "๐ŸŽ‰ Pipeline completed successfully!" + - 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: status: success notify_failure: image: alpine:latest commands: - - echo "Pipeline completed for ${DRONE_BRANCH}" - - echo "Build status: FAILURE" + - echo "โŒ Pipeline failed!" + - 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: status: failure \ No newline at end of file