Files
Touchh/.drone.yml
2024-12-28 10:18:16 +09:00

62 lines
1.3 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: Django CI/CD
steps:
# Шаг 1: Клонирование репозитория
- name: clone
image: alpine/git
commands:
- git clone $DRONE_REPO_URL .
- git checkout $DRONE_COMMIT
# Шаг 2: Обновление и запуск с помощью update.sh
- name: deploy
image: docker:24
environment:
MYSQL_PASSWORD: touchh
commands:
- chmod +x ./bin/update.sh
- ./bin/update.sh
# Шаг 3: Миграция базы данных
- name: migrate
image: docker:24
environment:
MYSQL_PASSWORD: touchh
commands:
- chmod +x ./bin/cli.sh
- ./bin/cli migrate
# Шаг 4: Тестирование
- name: test
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
volumes:
- name: db_data
path: /var/lib/mysql
volumes:
- name: db_data
host:
path: ./var/mysql
trigger:
event:
- push
- pull_request