mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add more targets
- superuser - backup
This commit is contained in:
parent
f5fd0fc5be
commit
592e87941d
25
Makefile
25
Makefile
@ -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
|
20
tasks.py
20
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')
|
||||
|
Loading…
Reference in New Issue
Block a user