Files
Touchh/.drone.yml
2024-12-28 11:56:12 +09:00

67 lines
1.6 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
name: Touchh Hotel AntiFraud Pipeline
namespace: touchh
steps:
# Шаг 1: Клонирование репозитория
- name: clone_repo
image: alpine/git
commands:
- if [ ! -d .git ]; then git clone $DRONE_REPO_URL .; fi
- git fetch --all
- git reset --hard $DRONE_COMMIT
# Шаг 2: Обновление и запуск с помощью update.sh
- name: deploy_app
image: python:3.12-alpine
environment:
MYSQL_PASSWORD: touchh
commands:
- chmod +x ./bin/update
- ./bin/update
# Шаг 3: Установка зависимостей
- name: install_dependencies
image: python:3.12-alpine
environment:
MYSQL_PASSWORD: touchh
commands:
- chmod +x ./bin/pip3
- ./bin/pip3 install -r requirements.txt
# Шаг 4: Миграция базы данных
- name: run_migrations
image: python:3.12-alpine
environment:
MYSQL_PASSWORD: touchh
commands:
- chmod +x ./bin/cli
- ./bin/cli migrate
# Шаг 5: Тестирование
- name: run_tests
image: python:3.12-alpine
environment:
MYSQL_PASSWORD: touchh
commands:
- apk add --no-cache mariadb-client
- pip install -r requirements.txt
- python manage.py test
services:
# Внутренний сервис базы данных
- name: database_service
image: mariadb:11.6
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 1
MYSQL_DATABASE: touchh
MYSQL_USER: touchh
MYSQL_PASSWORD: touchh
tmpfs:
- /var/lib/mysql
trigger:
event:
- push
- pull_request