diff --git a/Makefile b/Makefile deleted file mode 100644 index 98df26bef6..0000000000 --- a/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -clean: - find . -path '*/__pycache__/*' -delete - find . -type d -name '__pycache__' -empty -delete - find . -name *.pyc -o -name *.pyo -delete - rm -rf *.egg-info - rm -rf .cache - rm -rf .tox - rm -f .coverage - -# Create a superuser account -superuser: - cd InvenTree && python3 manage.py createsuperuser - -# Install packages required to generate code docs -docreqs: - pip3 install -U -r docs/requirements.txt - -# Build code docs -docs: - cd docs && make html - -# Make database backup -backup: - cd InvenTree && python3 manage.py dbbackup - cd InvenTree && python3 manage.py mediabackup diff --git a/tasks.py b/tasks.py index 7db6b51d74..4725e32ef1 100644 --- a/tasks.py +++ b/tasks.py @@ -100,6 +100,14 @@ def install(c): print("Config file 'config.yaml' does not exist - copying from template.") copyfile(CONFIG_TEMPLATE_FILE, CONFIG_FILE) +@task +def superuser(c): + """ + Create a superuser (admin) account for the database. + """ + + manage(c, 'createsuperuser') + @task def migrate(c): """ @@ -222,3 +230,15 @@ def postgresql(c): c.run('sudo apt-get install postgresql postgresql-contrib libpq-dev') c.run('pip3 install psycopg2') + +@task +def backup(c): + """ + Create a backup of database models and uploaded media files. + + Backup files will be written to the 'backup_dir' file specified in 'config.yaml' + + """ + + manage(c, 'dbbackup') + manage(c, 'mediabackup')