timetracker/.drone.yml

55 lines
862 B
YAML

---
kind: pipeline
type: docker
name: default
steps:
- name: test
image: python:3.12
commands:
- python -m pip install poetry
- poetry install
- poetry env info
- poetry run python manage.py migrate
- poetry run pytest
- name: build-prod
image: plugins/docker
settings:
repo: registry.kucharczyk.xyz/timetracker
tags:
- latest
- 1.1.0
depends_on:
- "test"
when:
branch:
- main
- name: build-non-prod
image: plugins/docker
settings:
repo: registry.kucharczyk.xyz/timetracker
auto_tag: true
when:
branch:
exclude:
- main
depends_on:
- "test"
- name: redeploy on portainer
image: plugins/webhook
settings:
urls:
from_secret: PORTAINER_TIMETRACKER_WEBHOOK_URL
depends_on:
- "build-prod"
trigger:
event:
- push
- cron