44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
volumes:
|
|
pip_cache:
|
|
host:
|
|
path: /var/lib/woodpecker/pip-cache/intra_max_bot
|
|
|
|
steps:
|
|
test:
|
|
image: python:3.11-slim
|
|
volumes:
|
|
- pip_cache:/pip-cache
|
|
commands:
|
|
- export PIP_CACHE_DIR=/pip-cache
|
|
- python -m pip install -r requirements.txt
|
|
- export PYTHONPATH="$PWD"
|
|
- python -m pytest -q tests -p no:cacheprovider
|
|
when:
|
|
- event: [push, pull_request, manual]
|
|
|
|
deploy_no_docker:
|
|
image: appleboy/drone-ssh
|
|
settings:
|
|
host:
|
|
from_secret: forgejo_host_ssh
|
|
username:
|
|
from_secret: forgejo_user_ssh
|
|
key:
|
|
from_secret: forgejo_key_ssh
|
|
port:
|
|
from_secret: forgejo_port_ssh
|
|
script:
|
|
- cd /home/caps/intra_max_bot
|
|
- git pull --ff-only
|
|
- if [ ! -d .venv ]; then python3 -m venv .venv; fi
|
|
- . .venv/bin/activate
|
|
- pip install -r requirements.txt
|
|
- sudo systemctl restart max-support
|
|
- set -a
|
|
- . /home/caps/intra_max_bot/.env
|
|
- set +a
|
|
- curl -fsS http://127.0.0.1:${APP_PORT}/health
|
|
when:
|
|
- event: [push, manual]
|
|
- branch: [main, master]
|
|
|