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 environment: MYSQL_PASSWORD: touchh commands: - chmod +x ./bin/update - ./bin/update # Шаг 3: Миграция базы данных - name: run_migrations image: python:3.12 environment: MYSQL_PASSWORD: touchh commands: - chmod +x ./bin/cli - ./bin/cli migrate # Шаг 4: Тестирование - 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: db image: mariadb:11.6 environment: MYSQL_RANDOM_ROOT_PASSWORD: 1 MYSQL_DATABASE: touchh MYSQL_USER: touchh MYSQL_PASSWORD: touchh tmpfs: - /var/lib/mysql # Сервис Django (Web) - name: web image: touchh-py environment: MYSQL_PASSWORD: touchh command: ['python3', 'manage.py', 'runserver', '0.0.0.0:8000'] ports: - port: 8000 depends_on: - db # Сервис Telegram Bot - name: bot image: touchh-py environment: MYSQL_PASSWORD: touchh command: ['python3', 'manage.py', 'run_bot'] depends_on: - db # Сервис планировщика задач - name: scheduler image: touchh-py environment: MYSQL_PASSWORD: touchh command: ['python3', 'manage.py', 'start_scheduler'] depends_on: - db trigger: event: - push - pull_request