Migrate "mysql" and "postgresql" targets

This commit is contained in:
Oliver Walters 2020-08-21 21:17:38 +10:00
parent af50e29e2c
commit f5fd0fc5be
2 changed files with 24 additions and 12 deletions

View File

@ -10,17 +10,7 @@ clean:
# Create a superuser account # Create a superuser account
superuser: superuser:
cd InvenTree && python3 manage.py createsuperuser cd InvenTree && python3 manage.py createsuperuser
# Install pre-requisites for mysql setup
mysql:
sudo apt-get install mysql-server libmysqlclient-dev
pip3 install mysqlclient
# Install pre-requisites for postgresql setup
postgresql:
sudo apt-get install postgresql postgresql-contrib libpq-dev
pip3 install psycopg2
# Install packages required to generate code docs # Install packages required to generate code docs
docreqs: docreqs:
pip3 install -U -r docs/requirements.txt pip3 install -U -r docs/requirements.txt

View File

@ -199,4 +199,26 @@ def coverage(c):
)) ))
# Generate coverage report # Generate coverage report
c.run('coverage html') c.run('coverage html')
@task
def mysql(c):
"""
Install packages required for using InvenTree with a MySQL database.
"""
print('Installing packages required for MySQL')
c.run('sudo apt-get install mysql-server libmysqlclient-dev')
c.run('pip3 install mysqlclient')
@task
def postgresql(c):
"""
Install packages required for using InvenTree with a PostgreSQL database
"""
print("Installing packages required for PostgreSQL")
c.run('sudo apt-get install postgresql postgresql-contrib libpq-dev')
c.run('pip3 install psycopg2')