mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 01:55:39 +00:00
.github
InvenTree
ci
deploy
docker
Dockerfile
docker-compose.yml
gunicorn.conf.py
nginx.conf
start_dev_server.sh
start_prod_server.sh
start_worker.sh
images
.coveragerc
.gitattributes
.gitignore
CONTRIBUTING.md
LICENSE
README.md
crowdin.yml
requirements.txt
setup.cfg
tasks.py
- Data dumping and restoring is now very complex! - We should use the invoke export-records function now, rather than relying on dbbackup / dbrestore - Documentation will be updated to match
42 lines
1.3 KiB
Bash
42 lines
1.3 KiB
Bash
#!/bin/sh
|
|
|
|
# Create required directory structure (if it does not already exist)
|
|
if [[ ! -d "$INVENTREE_STATIC_ROOT" ]]; then
|
|
echo "Creating directory $INVENTREE_STATIC_ROOT"
|
|
mkdir $INVENTREE_STATIC_ROOT
|
|
fi
|
|
|
|
if [[ ! -d "$INVENTREE_MEDIA_ROOT" ]]; then
|
|
echo "Creating directory $INVENTREE_MEDIA_ROOT"
|
|
mkdir $INVENTREE_MEDIA_ROOT
|
|
fi
|
|
|
|
# Check if "config.yaml" has been copied into the correct location
|
|
if test -f "$INVENTREE_CONFIG_FILE"; then
|
|
echo "$INVENTREE_CONFIG_FILE exists - skipping"
|
|
else
|
|
echo "Copying config file to $INVENTREE_CONFIG_FILE"
|
|
cp $INVENTREE_SRC_DIR/InvenTree/config_template.yaml $INVENTREE_CONFIG_FILE
|
|
fi
|
|
|
|
echo "Starting InvenTree server..."
|
|
|
|
# Wait for the database to be ready
|
|
cd $INVENTREE_MNG_DIR
|
|
python manage.py wait_for_db
|
|
|
|
sleep 10
|
|
|
|
echo "Running InvenTree database migrations and collecting static files..."
|
|
|
|
# We assume at this stage that the database is up and running
|
|
# Ensure that the database schema are up to date
|
|
python manage.py check || exit 1
|
|
python manage.py migrate --noinput || exit 1
|
|
python manage.py migrate --run-syncdb || exit 1
|
|
python manage.py prerender || exit 1
|
|
python manage.py collectstatic --noinput || exit 1
|
|
python manage.py clearsessions || exit 1
|
|
|
|
# Launch a development server
|
|
python manage.py runserver -a 0.0.0.0:$INVENTREE_WEB_PORT |