More / Better Scripts for Task Running

This commit is contained in:
reverend 2021-12-31 23:27:06 +01:00
parent b23dc8a627
commit 0f7b799c11
2 changed files with 26 additions and 0 deletions

View File

@ -14,6 +14,7 @@ pandoc = "*"
pylint-django = "*" pylint-django = "*"
setuptools = "*" setuptools = "*"
django-nose = "*" django-nose = "*"
invoke = "*"
[packages] [packages]
django = "*" django = "*"
@ -30,3 +31,7 @@ showmigrations = "django_lostplaces/manage.py showmigrations"
makemigrations = "django_lostplaces/manage.py makemigrations --no-input" makemigrations = "django_lostplaces/manage.py makemigrations --no-input"
migrate = "django_lostplaces/manage.py migrate" migrate = "django_lostplaces/manage.py migrate"
build = "django_lostplaces/setup.py bdist_wheel --universal" build = "django_lostplaces/setup.py bdist_wheel --universal"
createsuperuser = "django_lostplaces/manage.py createsuperuser --noinput --username admin --email admin@example.org"
createsuperuser_prompt = "django_lostplaces/manage.py createsuperuser"
quickstart = "invoke quickstart"
security = "pipenv check"

21
tasks.py Normal file
View File

@ -0,0 +1,21 @@
from invoke import task
@task
def quickstart(c):
commands = [
'pipenv run migrate',
'pipenv run createsuperuser',
'pipenv run server'
]
c.run(' && '.join(commands))
@task
def live(c):
commands = [
'pipenv check',
'pipenv run test',
'pipenv run migrate',
'pipenv run createsuperuser_prompt'
'pipenv run server'
]
c.run(' && '.join(commands))