Files
marquiz-metrics/.drone.yml
13orlov b05a6165aa
All checks were successful
continuous-integration/drone/push Build is passing
good release 2.0 code name: chiki-puki
2025-08-31 22:28:24 +01:00

48 lines
1.1 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:
# ШАГ 1: ЛОГИНИМСЯ В DOCKER HUB
- 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
# ШАГ 2: ЗАПУСКАЕМ ТЕСТЫ
- name: testing
image: python:3.11-slim
environment:
YANDEX_CLIENT_ID: "test_id_from_drone"
YANDEX_CLIENT_SECRET: "test_secret_from_drone"
commands:
- pip install poetry
- poetry install
- poetry run pytest -v
# ШАГ 3: ДЕПЛОИМ
- 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
- cat envs/common.env envs/staging.env > .env.staging
- make staging-up
- echo "Deployment finished!"