1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

36 lines
1.0 KiB
Bash
Raw Normal View History

#!/bin/bash
# This script will prepare NetBox to run after the code has been upgraded to
# its most recent release.
#
# Once the script completes, remember to restart the WSGI service (e.g.
# gunicorn or uWSGI).
PYTHON="python3"
PIP="pip3"
# TODO: Remove this in v2.6 as it is no longer needed under Python 3
2017-04-27 14:42:52 -04:00
# Delete stale bytecode
COMMAND="find . -name \"*.pyc\" -delete"
2017-04-27 14:42:52 -04:00
echo "Cleaning up stale Python bytecode ($COMMAND)..."
eval $COMMAND
2017-04-27 14:42:52 -04:00
# Uninstall any Python packages which are no longer needed
COMMAND="${PIP} uninstall -r old_requirements.txt -y"
echo "Removing old Python packages ($COMMAND)..."
eval $COMMAND
# Install any new Python packages
COMMAND="${PIP} install -r requirements.txt --upgrade"
echo "Updating required Python packages ($COMMAND)..."
eval $COMMAND
# Apply any database migrations
COMMAND="${PYTHON} netbox/manage.py migrate"
2017-05-18 14:53:35 -04:00
echo "Applying database migrations ($COMMAND)..."
2017-04-27 14:42:52 -04:00
eval $COMMAND
# Collect static files
COMMAND="${PYTHON} netbox/manage.py collectstatic --no-input"
2017-04-27 14:42:52 -04:00
echo "Collecting static files ($COMMAND)..."
eval $COMMAND