forked from bb-Ricardo/netbox-sync
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·32 lines (27 loc) · 792 Bytes
/
setup.sh
File metadata and controls
executable file
·32 lines (27 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -e
# Prerequsite package for pip install
sudo apt install python3-venv
# Set venv directory
VENV_DIR="./venv"
# Check if venv already exists
if [[ -d "$VENV_DIR" ]]; then
echo "Virtual environment already exists at $VENV_DIR"
else
echo "Creating virtual environment in $VENV_DIR"
python3 -m venv "$VENV_DIR"
fi
source "$VENV_DIR/bin/activate"
echo "Upgrading pip"
python3 -m pip install --upgrade pip
echo "Installing wheel"
python3 -m pip install wheel
echo "Installing python libaries"
python3 -m pip install -r requirements.txt
# ensure session.sh exists by copying from example if missing
if [ ! -f "session.sh" ]; then
cp "session.sh.example" "session.sh"
chmod +x "session.sh"
echo " "
echo "New session.sh created from session.sh.example"
fi