|
@@ -7,9 +7,8 @@ kind: pipeline
|
|
|
name: run_tests
|
|
|
|
|
|
steps:
|
|
|
- # Run tests against Python/Flask engine backend (with pytest)
|
|
|
- - name: django_tests
|
|
|
- image: python:3.10.4
|
|
|
+ - name: pytest with coverage
|
|
|
+ image: python:3.11.1
|
|
|
commands:
|
|
|
# Install dependencies
|
|
|
- cp emus.conf.example emus.conf
|
|
@@ -23,6 +22,24 @@ steps:
|
|
|
# Mount pip cache from host
|
|
|
- name: pip_cache
|
|
|
path: /root/.cache/pip
|
|
|
+ - name: deploy
|
|
|
+ image: appleboy/drone-ssh
|
|
|
+ settings:
|
|
|
+ host:
|
|
|
+ - emus.service
|
|
|
+ username: root
|
|
|
+ ssh_key:
|
|
|
+ from_secret: ssh_key
|
|
|
+ command_timeout: 2m
|
|
|
+ script:
|
|
|
+ - pip uninstall -y emus_web
|
|
|
+ - pip install git+https://code.unbl.ink/secstate/emus.git@main
|
|
|
+ - emus_web migrate
|
|
|
+ - emus_web collectstatic --noinput
|
|
|
+ - immortalctl restart emus
|
|
|
+ when:
|
|
|
+ branch:
|
|
|
+ - main
|
|
|
volumes:
|
|
|
- name: docker
|
|
|
host:
|