created install and run script for izzy
parent
45836fad1a
commit
55ff0637a7
|
|
@ -0,0 +1,49 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Variables
|
||||
TOKEN="5e89aca6a16c2f6b8fb44a97903b7bc593dd1889"
|
||||
REPO_URL="https://Izzy:$TOKEN@git.peninsulaindustries.com/bryanb/Link-Tracker-Server.git"
|
||||
PROJECT_DIR="$HOME/Desktop/link-tracker"
|
||||
PYTHON_BIN=$(which python3)
|
||||
|
||||
# Step 1: Check Homebrew
|
||||
if ! command -v brew &> /dev/null; then
|
||||
echo "Installing Homebrew..."
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
else
|
||||
echo "Homebrew already installed."
|
||||
fi
|
||||
|
||||
# Step 2: Check Python
|
||||
if ! command -v python3 &> /dev/null; then
|
||||
echo "Installing Python..."
|
||||
brew install python
|
||||
else
|
||||
echo "Python already installed."
|
||||
fi
|
||||
|
||||
# Step 3: Clone or Update Repository
|
||||
if [ ! -d "$PROJECT_DIR" ]; then
|
||||
echo "Cloning repository..."
|
||||
git clone "$REPO_URL" "$PROJECT_DIR"
|
||||
else
|
||||
echo "Updating repository..."
|
||||
cd "$PROJECT_DIR"
|
||||
git pull
|
||||
fi
|
||||
|
||||
# Step 4: Setup Virtual Environment
|
||||
cd "$PROJECT_DIR"
|
||||
if [ ! -d "venv" ]; then
|
||||
echo "Creating virtual environment..."
|
||||
$PYTHON_BIN -m venv venv
|
||||
fi
|
||||
|
||||
# Activate environment and install packages
|
||||
source venv/bin/activate
|
||||
echo "Installing required packages..."
|
||||
pip install -r requirements.txt
|
||||
|
||||
# Step 5: Run the Server
|
||||
echo "Starting the server..."
|
||||
python main.py
|
||||
Loading…
Reference in New Issue