setup.sh hinzugefügt
This commit is contained in:
50
setup.sh
Normal file
50
setup.sh
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Farben für die Ausgabe
|
||||||
|
GREEN='\033[0-32m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
echo -e "${GREEN}>>> Starte Pi-Orchestrator Master Installation...${NC}"
|
||||||
|
|
||||||
|
# 1. System-Abhängigkeiten installieren
|
||||||
|
echo "--- Installiere System-Pakete (sshpass, git, python3-venv)..."
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y sshpass git python3-pip python3-venv curl
|
||||||
|
|
||||||
|
# 2. Projekt-Verzeichnis vorbereiten (falls nicht schon im Repo)
|
||||||
|
# Annahme: Das Script wird im Root des Repos ausgeführt
|
||||||
|
if [ ! -f "requirements.txt" ]; then
|
||||||
|
echo "Fehler: requirements.txt nicht gefunden. Bitte im Root des Repos ausführen."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. Python Virtual Environment erstellen
|
||||||
|
echo "--- Erstelle Virtual Environment..."
|
||||||
|
python3 -m venv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
|
||||||
|
# 4. Python-Abhängigkeiten installieren
|
||||||
|
echo "--- Installiere Python-Pakete..."
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
# 5. SSH-Key für den Master prüfen/erstellen
|
||||||
|
if [ ! -f "$HOME/.ssh/id_rsa" ]; then
|
||||||
|
echo "--- Generiere SSH-Key für passwortlose Kommunikation..."
|
||||||
|
ssh-keygen -t rsa -N "" -f "$HOME/.ssh/id_rsa"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 6. Docker installieren (falls noch nicht da)
|
||||||
|
if ! [ -x "$(command -v docker)" ]; then
|
||||||
|
echo "--- Installiere Docker..."
|
||||||
|
curl -sSL https://get.docker.com | sh
|
||||||
|
sudo usermod -aG docker $USER
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${GREEN}>>> Installation abgeschlossen!${NC}"
|
||||||
|
echo "Starte den Bot auf Port 8000..."
|
||||||
|
|
||||||
|
# 7. Programm starten
|
||||||
|
# Wir nutzen uvicorn für das FastAPI Backend
|
||||||
|
source venv/bin/activate
|
||||||
|
python3 -m uvicorn main:app --host 0.0.0.0 --port 8000
|
||||||
Reference in New Issue
Block a user