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.

62 lines
1.4 KiB

from pathlib import Path
from invoke import task
BASE_DIR = Path(__file__).parent.resolve(strict=True)
SRC_DIR = BASE_DIR / "src"
def test(ctx):
with"pytest", pty=True, echo=True)
def test_cov(ctx):
"pytest --cov=. --cov-report term-missing:skip-covered",
def check(ctx):
with"pre-commit run --all-files", pty=True)"mypy src", pty=True)
def build(ctx):
with"docker-compose build django", pty=True, echo=True)
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)
@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)