--- ################ # 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_web migrate - emus_web 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