chore: unified logging in install.sh
- All build logs now written to spawner-install.log - Added clear section headers for each build - Replaced separate temp log files with single log file - Added log file path hint at end of installation
This commit is contained in:
parent
4b8cd3eb4a
commit
912904802c
43
install.sh
43
install.sh
|
|
@ -10,6 +10,7 @@ REPO_URL="https://gitea.iotxs.de/RainerWieland/spawner.git"
|
||||||
RAW_URL="https://gitea.iotxs.de/RainerWieland/spawner/raw/branch/main"
|
RAW_URL="https://gitea.iotxs.de/RainerWieland/spawner/raw/branch/main"
|
||||||
INSTALL_DIR="${PWD}"
|
INSTALL_DIR="${PWD}"
|
||||||
VERSION="0.1.0"
|
VERSION="0.1.0"
|
||||||
|
LOG_FILE="${INSTALL_DIR}/spawner-install.log"
|
||||||
|
|
||||||
# Farben fuer Output
|
# Farben fuer Output
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
|
|
@ -76,6 +77,10 @@ echo " Container Spawner Installation v${VERSION}"
|
||||||
echo "============================================================"
|
echo "============================================================"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
# Log-Datei initialisieren
|
||||||
|
echo "=== Spawner Installation $(date) ===" > "${LOG_FILE}"
|
||||||
|
echo "" >> "${LOG_FILE}"
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# 1. Pruefe .env
|
# 1. Pruefe .env
|
||||||
# ============================================================
|
# ============================================================
|
||||||
|
|
@ -381,8 +386,10 @@ if [ -d "${INSTALL_DIR}/user-template" ]; then
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Build ausfuehren und Output in Datei speichern
|
# Build ausfuehren und Output in Datei speichern
|
||||||
BUILD_LOG="/tmp/build-user-template.log"
|
BUILD_LOG="${LOG_FILE}"
|
||||||
docker build --no-cache -t user-service-template:latest "${INSTALL_DIR}/user-template/" > "${BUILD_LOG}" 2>&1
|
echo "" >> "${LOG_FILE}"
|
||||||
|
echo "=== Build: user-service-template ===" >> "${LOG_FILE}"
|
||||||
|
docker build --no-cache -t user-service-template:latest "${INSTALL_DIR}/user-template/" >> "${BUILD_LOG}" 2>&1
|
||||||
BUILD_EXIT=$?
|
BUILD_EXIT=$?
|
||||||
|
|
||||||
# Gefilterten Output anzeigen
|
# Gefilterten Output anzeigen
|
||||||
|
|
@ -395,8 +402,9 @@ if [ -d "${INSTALL_DIR}/user-template" ]; then
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
echo -e " user-service-template: ${RED}FEHLER${NC}"
|
echo -e " user-service-template: ${RED}FEHLER${NC}"
|
||||||
echo " Build-Log:"
|
echo " Siehe Build-Log: ${LOG_FILE}"
|
||||||
cat "${BUILD_LOG}"
|
echo " Letzte 50 Zeilen:"
|
||||||
|
tail -50 "${BUILD_LOG}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
@ -407,8 +415,10 @@ if [ -d "${INSTALL_DIR}/user-template-next" ]; then
|
||||||
echo -e " ${BLUE}Dies kann 2-5 Minuten dauern (npm install + build)...${NC}"
|
echo -e " ${BLUE}Dies kann 2-5 Minuten dauern (npm install + build)...${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
BUILD_LOG="/tmp/build-user-template-next.log"
|
BUILD_LOG="${LOG_FILE}"
|
||||||
docker build --no-cache -t user-template-next:latest "${INSTALL_DIR}/user-template-next/" > "${BUILD_LOG}" 2>&1
|
echo "" >> "${LOG_FILE}"
|
||||||
|
echo "=== Build: user-template-next ===" >> "${LOG_FILE}"
|
||||||
|
docker build --no-cache -t user-template-next:latest "${INSTALL_DIR}/user-template-next/" >> "${BUILD_LOG}" 2>&1
|
||||||
BUILD_EXIT=$?
|
BUILD_EXIT=$?
|
||||||
|
|
||||||
grep -E "(Step |#[0-9]+ |Successfully|ERROR|error:|COPY|RUN|FROM)" "${BUILD_LOG}" 2>/dev/null | sed 's/^/ /' || true
|
grep -E "(Step |#[0-9]+ |Successfully|ERROR|error:|COPY|RUN|FROM)" "${BUILD_LOG}" 2>/dev/null | sed 's/^/ /' || true
|
||||||
|
|
@ -426,8 +436,10 @@ fi
|
||||||
echo " [3/4] Baue Spawner API (Flask Backend)..."
|
echo " [3/4] Baue Spawner API (Flask Backend)..."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
BUILD_LOG="/tmp/build-spawner.log"
|
BUILD_LOG="${LOG_FILE}"
|
||||||
docker build --no-cache -t spawner:latest "${INSTALL_DIR}/" > "${BUILD_LOG}" 2>&1
|
echo "" >> "${LOG_FILE}"
|
||||||
|
echo "=== Build: spawner-api ===" >> "${LOG_FILE}"
|
||||||
|
docker build --no-cache -t spawner:latest "${INSTALL_DIR}/" >> "${BUILD_LOG}" 2>&1
|
||||||
BUILD_EXIT=$?
|
BUILD_EXIT=$?
|
||||||
|
|
||||||
grep -E "(Step |#[0-9]+ |Successfully|ERROR|error:|COPY|RUN|FROM)" "${BUILD_LOG}" 2>/dev/null | sed 's/^/ /' || true
|
grep -E "(Step |#[0-9]+ |Successfully|ERROR|error:|COPY|RUN|FROM)" "${BUILD_LOG}" 2>/dev/null | sed 's/^/ /' || true
|
||||||
|
|
@ -438,8 +450,9 @@ if [ $BUILD_EXIT -eq 0 ] && docker image inspect spawner:latest >/dev/null 2>&1;
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
echo -e " spawner-api: ${RED}FEHLER${NC}"
|
echo -e " spawner-api: ${RED}FEHLER${NC}"
|
||||||
echo " Build-Log:"
|
echo " Siehe Build-Log: ${LOG_FILE}"
|
||||||
cat "${BUILD_LOG}"
|
echo " Letzte 50 Zeilen:"
|
||||||
|
tail -50 "${BUILD_LOG}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -449,8 +462,10 @@ if [ -d "${INSTALL_DIR}/frontend" ]; then
|
||||||
echo -e " ${BLUE}Dies kann 2-5 Minuten dauern (npm install + build)...${NC}"
|
echo -e " ${BLUE}Dies kann 2-5 Minuten dauern (npm install + build)...${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
BUILD_LOG="/tmp/build-frontend.log"
|
BUILD_LOG="${LOG_FILE}"
|
||||||
docker build --no-cache -t spawner-frontend:latest "${INSTALL_DIR}/frontend/" > "${BUILD_LOG}" 2>&1
|
echo "" >> "${LOG_FILE}"
|
||||||
|
echo "=== Build: spawner-frontend ===" >> "${LOG_FILE}"
|
||||||
|
docker build --no-cache -t spawner-frontend:latest "${INSTALL_DIR}/frontend/" >> "${BUILD_LOG}" 2>&1
|
||||||
BUILD_EXIT=$?
|
BUILD_EXIT=$?
|
||||||
|
|
||||||
grep -E "(Step |#[0-9]+ |Successfully|ERROR|error:|COPY|RUN|FROM)" "${BUILD_LOG}" 2>/dev/null | sed 's/^/ /' || true
|
grep -E "(Step |#[0-9]+ |Successfully|ERROR|error:|COPY|RUN|FROM)" "${BUILD_LOG}" 2>/dev/null | sed 's/^/ /' || true
|
||||||
|
|
@ -461,7 +476,8 @@ if [ -d "${INSTALL_DIR}/frontend" ]; then
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
echo -e " spawner-frontend: ${RED}FEHLER${NC}"
|
echo -e " spawner-frontend: ${RED}FEHLER${NC}"
|
||||||
echo " Build-Log (letzte 50 Zeilen):"
|
echo " Siehe Build-Log: ${LOG_FILE}"
|
||||||
|
echo " Letzte 50 Zeilen:"
|
||||||
tail -50 "${BUILD_LOG}"
|
tail -50 "${BUILD_LOG}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -505,6 +521,7 @@ echo "============================================================"
|
||||||
echo -e " ${GREEN}Installation abgeschlossen!${NC}"
|
echo -e " ${GREEN}Installation abgeschlossen!${NC}"
|
||||||
echo "============================================================"
|
echo "============================================================"
|
||||||
echo ""
|
echo ""
|
||||||
|
echo "Installations-Log: ${LOG_FILE}"
|
||||||
|
|
||||||
# URLs anzeigen
|
# URLs anzeigen
|
||||||
SCHEME="https"
|
SCHEME="https"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user