Gab's Notes backend
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.4 KiB

from pathlib import Path
from invoke import task
BASE_DIR = Path(__file__).parent.resolve(strict=True)
10 months ago
SRC_DIR = BASE_DIR / "src"
def test(ctx):
10 months ago
with"pytest", pty=True, echo=True)
def test_cov(ctx):
10 months ago
"pytest --cov=. --cov-report term-missing:skip-covered",
9 months ago
def check(ctx):
with"pre-commit run --all-files", pty=True)"mypy src", pty=True)
10 months ago
def build(ctx):
with"docker-compose build django", pty=True, echo=True)
10 months ago
def publish(ctx):
with"docker-compose push django", pty=True, echo=True)
def deploy(ctx):"ssh ubuntu /home/gaugendre/blog/update", pty=True, echo=True)
9 months ago
@task(pre=[check, build, publish, deploy])
def beam(ctx):
def download_db(ctx):
with"scp ubuntu:/home/gaugendre/blog/db/db.sqlite3 ./db/db.sqlite3")"rm -rf src/media/")"scp -r ubuntu:/home/gaugendre/blog/media/ ./src/media")
with"./ two_factor_disable gaugendre", pty=True)"./ changepassword gaugendre", pty=True)