2023-01-02 17:35:05 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2023-01-05 10:52:50 +00:00
|
|
|
name: default
|
2023-01-02 17:35:05 +00:00
|
|
|
|
|
|
|
steps:
|
2023-01-05 10:52:50 +00:00
|
|
|
- name: test
|
2023-11-16 15:30:17 +00:00
|
|
|
image: python:3.12
|
2023-01-05 10:52:50 +00:00
|
|
|
commands:
|
2023-01-05 11:05:16 +00:00
|
|
|
- python -m pip install poetry
|
|
|
|
- poetry install
|
|
|
|
- poetry env info
|
2023-11-12 07:11:22 +00:00
|
|
|
- poetry run python manage.py migrate
|
2023-01-05 11:19:32 +00:00
|
|
|
- poetry run pytest
|
2023-10-04 17:53:25 +00:00
|
|
|
|
|
|
|
- name: build-prod
|
2023-01-02 17:35:05 +00:00
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
2023-01-02 17:37:59 +00:00
|
|
|
repo: registry.kucharczyk.xyz/timetracker
|
2023-01-03 20:35:09 +00:00
|
|
|
tags:
|
|
|
|
- latest
|
2023-10-08 22:04:46 +00:00
|
|
|
- 1.1.0
|
2023-10-04 17:53:25 +00:00
|
|
|
depends_on:
|
|
|
|
- "test"
|
2023-01-25 10:36:34 +00:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- main
|
|
|
|
|
2023-10-04 17:53:25 +00:00
|
|
|
- name: build-non-prod
|
2023-01-25 10:36:34 +00:00
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
repo: registry.kucharczyk.xyz/timetracker
|
|
|
|
tags:
|
|
|
|
- ${DRONE_COMMIT_REF}
|
|
|
|
- ${DRONE_COMMIT_BRANCH}
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
exclude:
|
|
|
|
- main
|
2023-10-04 17:53:25 +00:00
|
|
|
depends_on:
|
|
|
|
- "test"
|
|
|
|
|
|
|
|
- name: redeploy on portainer
|
|
|
|
image: plugins/webhook
|
|
|
|
settings:
|
|
|
|
urls:
|
|
|
|
from_secret: PORTAINER_TIMETRACKER_WEBHOOK_URL
|
|
|
|
depends_on:
|
|
|
|
- "build-prod"
|
|
|
|
|
2023-01-25 10:36:34 +00:00
|
|
|
|
|
|
|
|
2023-01-02 17:35:05 +00:00
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- push
|
2023-10-04 17:53:25 +00:00
|
|
|
- cron
|