morss/.drone.yml

96 lines
1.4 KiB
YAML

---
kind: pipeline
name: test
steps:
- name: lint
image: alpine
commands:
- apk add --no-cache python3 py3-lxml py3-setproctitle py3-pip py3-wheel py3-enchant hunspell-en
- pip3 install --no-cache-dir .[full] .[dev]
- isort --check-only --diff .
- pylint morss --rcfile=.pylintrc --disable=C,R,W --fail-under=8
---
kind: pipeline
name: python
steps:
- name: publish
image: plugins/pypi
settings:
username:
from_secret: pypi_user
password:
from_secret: pypi_pwd
trigger:
branch:
- master
event:
- push
depends_on:
- test
---
kind: pipeline
name: docker
steps:
- name: publish
image: thegeeklab/drone-docker-buildx
# NB. this requires qemu installed on host
privileged: true
settings:
username:
from_secret: docker_user
password:
from_secret: docker_pwd
repo:
from_secret: docker_repo
tags: latest
platforms: linux/amd64,linux/arm64,linux/arm/v7
trigger:
branch:
- master
event:
- push
depends_on:
- test
---
kind: pipeline
type: ssh
name: prod
server:
host:
from_secret: ssh_host
user:
from_secret: ssh_user
ssh_key:
from_secret: ssh_key
steps:
- name: install
commands:
- sudo pip install --upgrade morss[full]
- name: reload
commands:
- pid=$$(sudo pidof 'gunicorn: master [morss]')
- sudo kill -s USR2 $$pid
- sudo kill -s WINCH $$pid
- sudo kill -s TERM $$pid
trigger:
branch:
- master
event:
- push
depends_on:
- python