12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- ---
- ################
- # Build & Test #
- ################
- kind: pipeline
- name: run_tests
- steps:
- - name: pytest with coverage
- image: python:3.11.1
- commands:
- # Install dependencies
- - cp emus.conf.example emus.conf
- - pip install poetry
- - poetry install
- # Start with a fresh database (which is already running as a service from Drone)
- - poetry run python manage.py test
- environment:
- EMUS_DATABASE_URL: sqlite:///test.db
- volumes:
- # 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 migrate
- - emus collectstatic --noinput
- - immortalctl restart emus
- when:
- branch:
- - main
- volumes:
- - name: docker
- host:
- path: /var/run/docker.sock
- - name: pip_cache
- host:
- path: /tmp/cache/drone/pip
|