mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Improved upgrade script
This commit is contained in:
16
upgrade.sh
16
upgrade.sh
@ -15,6 +15,11 @@ if [ "$(whoami)" = "root" ]; then
|
|||||||
PREFIX=""
|
PREFIX=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Delete stale bytecode
|
||||||
|
COMMAND="${PREFIX}find . -name \"*.pyc\" -delete"
|
||||||
|
echo "Cleaning up stale Python bytecode ($COMMAND)..."
|
||||||
|
#eval $COMMAND
|
||||||
|
|
||||||
# Fall back to pip3 if pip is missing
|
# Fall back to pip3 if pip is missing
|
||||||
PIP="pip"
|
PIP="pip"
|
||||||
type $PIP >/dev/null 2>&1 || PIP="pip3"
|
type $PIP >/dev/null 2>&1 || PIP="pip3"
|
||||||
@ -25,10 +30,11 @@ echo "Updating required Python packages ($COMMAND)..."
|
|||||||
eval $COMMAND
|
eval $COMMAND
|
||||||
|
|
||||||
# Apply any database migrations
|
# Apply any database migrations
|
||||||
./netbox/manage.py migrate
|
COMMAND="./netbox/manage.py migrate"
|
||||||
|
echo "Updating required Python packages ($COMMAND)..."
|
||||||
|
eval $COMMAND
|
||||||
|
|
||||||
# Collect static files
|
# Collect static files
|
||||||
./netbox/manage.py collectstatic --no-input
|
COMMAND="./netbox/manage.py collectstatic --no-input"
|
||||||
|
echo "Collecting static files ($COMMAND)..."
|
||||||
# Delete old bytecode
|
eval $COMMAND
|
||||||
find . -name "*.pyc" -delete
|
|
||||||
|
Reference in New Issue
Block a user