From 0f7b799c119717385e51be991a79c9917ffe7db4 Mon Sep 17 00:00:00 2001 From: reverend Date: Fri, 31 Dec 2021 23:27:06 +0100 Subject: [PATCH] More / Better Scripts for Task Running --- Pipfile | 5 +++++ tasks.py | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tasks.py diff --git a/Pipfile b/Pipfile index 5325444..3afedd3 100644 --- a/Pipfile +++ b/Pipfile @@ -14,6 +14,7 @@ pandoc = "*" pylint-django = "*" setuptools = "*" django-nose = "*" +invoke = "*" [packages] django = "*" @@ -30,3 +31,7 @@ showmigrations = "django_lostplaces/manage.py showmigrations" makemigrations = "django_lostplaces/manage.py makemigrations --no-input" migrate = "django_lostplaces/manage.py migrate" 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" \ No newline at end of file diff --git a/tasks.py b/tasks.py new file mode 100644 index 0000000..149c14f --- /dev/null +++ b/tasks.py @@ -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)) \ No newline at end of file