Files
marquiz-metrics/.drone.yml
13orlov 6fc14db51e
All checks were successful
continuous-integration/drone/push Build is passing
refactor(tests): Simplify test setup and fix client fixture
2025-08-23 22:36:23 +01:00

48 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

kind: pipeline
type: docker
name: build-and-deploy-staging
trigger:
branch:
- staging
event:
- push
steps:
- name: docker-login
image: docker:latest
environment:
DOCKER_USERNAME:
from_secret: DOCKER_USERNAME
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
commands:
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
- name: testing
image: python:3.11-slim
commands:
# 1. Создаем .env файл. pydantic-settings его найдет и использует.
- echo 'YANDEX_CLIENT_ID="test_id"' > .env
- echo 'YANDEX_CLIENT_SECRET="test_secret"' >> .env
# 2. Устанавливаем зависимости
- pip install poetry
- poetry install
# 3. Запускаем тесты
- poetry run pytest -v
- name: deploy
image: appleboy/drone-ssh
settings:
host: 45.86.181.80
port: 2223
username: orlov
key:
from_secret: DEPLOY_STAG_SSH_KEY
script:
- cd /home/orlov/apps/marquiz-metrics-staging
- git pull origin staging
- docker compose up -d --build
- echo "Deployment finished successfully!"