timetracker/.drone.yml

59 lines
978 B
YAML

---
kind: pipeline
type: docker
name: default
steps:
- name: test
image: python:3.10
commands:
- python -m pip install poetry
- poetry install
- poetry env info
- poetry run pytest
- name: build-prod
image: plugins/docker
settings:
repo: registry.kucharczyk.xyz/timetracker
tags:
- latest
depends_on:
- "test"
when:
branch:
- main
- name: build-non-prod
image: plugins/docker
settings:
repo: registry.kucharczyk.xyz/timetracker
tags:
- ${DRONE_COMMIT_REF}
- ${DRONE_COMMIT_BRANCH}
when:
branch:
exclude:
- main
depends_on:
- "test"
- name: redeploy on portainer
image: plugins/webhook
environment:
WEBHOOK_ID:
from_secret: PORTAINER_TIMETRACKER_WEBHOOK_ID
settings:
urls: [ "https://portainer.kucharczyk.xyz/api/webhooks/$WEBHOOK_ID" ]
commands:
- "env"
# depends_on:
# - "build-prod"
trigger:
event:
- push
- cron