Alarig Le Lay
b4448317d6
Package-Manager: Portage-3.0.13, Repoman-3.0.2 Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr
52 lines
1.7 KiB
Diff
52 lines
1.7 KiB
Diff
--- a/upgrade.sh 2021-03-15 14:54:09.287164820 +0100
|
|
+++ b/upgrade.sh 2021-03-15 15:08:32.463687738 +0100
|
|
@@ -14,48 +14,6 @@
|
|
WARN_MISSING_VENV=1
|
|
fi
|
|
|
|
-# Create a new virtual environment
|
|
-COMMAND="/usr/bin/python3 -m venv ${VIRTUALENV}"
|
|
-echo "Creating a new virtual environment at ${VIRTUALENV}..."
|
|
-eval $COMMAND || {
|
|
- echo "--------------------------------------------------------------------"
|
|
- echo "ERROR: Failed to create the virtual environment. Check that you have"
|
|
- echo "the required system packages installed and the following path is"
|
|
- echo "writable: ${VIRTUALENV}"
|
|
- echo "--------------------------------------------------------------------"
|
|
- exit 1
|
|
-}
|
|
-
|
|
-# Activate the virtual environment
|
|
-source "${VIRTUALENV}/bin/activate"
|
|
-
|
|
-# Upgrade pip
|
|
-COMMAND="pip install --upgrade pip"
|
|
-echo "Updating pip ($COMMAND)..."
|
|
-eval $COMMAND || exit 1
|
|
-pip -V
|
|
-
|
|
-# Install necessary system packages
|
|
-COMMAND="pip install wheel"
|
|
-echo "Installing Python system packages ($COMMAND)..."
|
|
-eval $COMMAND || exit 1
|
|
-
|
|
-# Install required Python packages
|
|
-COMMAND="pip install -r requirements.txt"
|
|
-echo "Installing core dependencies ($COMMAND)..."
|
|
-eval $COMMAND || exit 1
|
|
-
|
|
-# Install optional packages (if any)
|
|
-if [ -s "local_requirements.txt" ]; then
|
|
- COMMAND="pip install -r local_requirements.txt"
|
|
- echo "Installing local dependencies ($COMMAND)..."
|
|
- eval $COMMAND || exit 1
|
|
-elif [ -f "local_requirements.txt" ]; then
|
|
- echo "Skipping local dependencies (local_requirements.txt is empty)"
|
|
-else
|
|
- echo "Skipping local dependencies (local_requirements.txt not found)"
|
|
-fi
|
|
-
|
|
# Apply any database migrations
|
|
COMMAND="python3 netbox/manage.py migrate"
|
|
echo "Applying database migrations ($COMMAND)..."
|