Update fix-dependencies.sh to use --legacy-peer-deps during npm install and add client build and file copy steps for improved deployment process.

This commit is contained in:
Torsten Schulz (local)
2025-12-04 17:14:36 +01:00
parent d1290ace60
commit b6eef5100f

View File

@@ -46,7 +46,7 @@ echo "✓ Root-Dependencies installiert"
# Installiere Client-Dependencies # Installiere Client-Dependencies
echo "" echo ""
echo "Installiere Client-Dependencies..." echo "Installiere Client-Dependencies..."
sudo -u $USER bash -c "cd '$TARGET_DIR/client' && HOME='$TARGET_DIR' npm config set cache '$NPM_CACHE_DIR' && npm install" sudo -u $USER bash -c "cd '$TARGET_DIR/client' && HOME='$TARGET_DIR' npm config set cache '$NPM_CACHE_DIR' && npm install --legacy-peer-deps"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "FEHLER: Installation der Client-Dependencies fehlgeschlagen!" echo "FEHLER: Installation der Client-Dependencies fehlgeschlagen!"
@@ -55,6 +55,28 @@ fi
echo "✓ Client-Dependencies installiert" echo "✓ Client-Dependencies installiert"
# Baue Client
echo ""
echo "Baue Client für Production..."
sudo -u $USER bash -c "cd '$TARGET_DIR' && HOME='$TARGET_DIR' npm config set cache '$NPM_CACHE_DIR' && npm run build"
if [ $? -ne 0 ]; then
echo "FEHLER: Build fehlgeschlagen!"
exit 1
fi
echo "✓ Client gebaut"
# Kopiere dist nach docroot
echo ""
echo "Kopiere gebaute Dateien nach docroot..."
if [ -d "$TARGET_DIR/docroot/dist" ]; then
rm -rf "$TARGET_DIR/docroot/dist"
fi
cp -r "$TARGET_DIR/client/dist" "$TARGET_DIR/docroot/"
chown -R $USER:$GROUP "$TARGET_DIR/docroot/dist"
echo "✓ Dateien kopiert"
# Setze Besitzer für node_modules # Setze Besitzer für node_modules
echo "" echo ""
echo "Setze Besitzer für node_modules..." echo "Setze Besitzer für node_modules..."