ci: Create .env.test file during testing step
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
12
.drone.yml
12
.drone.yml
@@ -9,7 +9,6 @@ trigger:
|
|||||||
- push
|
- push
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Шаг 'docker-login' остается без изменений
|
|
||||||
- name: docker-login
|
- name: docker-login
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
environment:
|
environment:
|
||||||
@@ -20,20 +19,25 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
|
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
|
||||||
|
|
||||||
# Шаг 'testing' остается без изменений
|
# --- ИЗМЕНЕНИЕ ЗДЕСЬ ---
|
||||||
- name: testing
|
- name: testing
|
||||||
image: python:3.11-slim
|
image: python:3.11-slim
|
||||||
commands:
|
commands:
|
||||||
|
# 1. Создаем .env.test файл для pytest ПЕРЕД установкой зависимостей
|
||||||
|
- echo 'YANDEX_CLIENT_ID="test_id"' > .env.test
|
||||||
|
- echo 'YANDEX_CLIENT_SECRET="test_secret"' >> .env.test
|
||||||
|
|
||||||
|
# 2. Устанавливаем зависимости
|
||||||
- pip install poetry
|
- pip install poetry
|
||||||
- poetry install
|
- poetry install
|
||||||
|
|
||||||
|
# 3. Запускаем тесты
|
||||||
- poetry run pytest -v
|
- poetry run pytest -v
|
||||||
|
|
||||||
# ИЗМЕНЕНИЕ ЗДЕСЯ
|
|
||||||
- name: deploy
|
- name: deploy
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
host: 45.86.181.80
|
host: 45.86.181.80
|
||||||
# ЯВНО УКАЗЫВАЕМ ПРАВИЛЬНЫЙ ПОРТ ДЛЯ SSH
|
|
||||||
port: 2223
|
port: 2223
|
||||||
username: orlov
|
username: orlov
|
||||||
key:
|
key:
|
||||||
|
|||||||
Reference in New Issue
Block a user