Enhance auto-deploy script for Flutter frontend by ensuring a clean build environment and fetching packages
This commit is contained in:
@@ -62,6 +62,12 @@ echo "=== Deploying Frontend ==="
|
|||||||
echo "Building Flutter web app..."
|
echo "Building Flutter web app..."
|
||||||
FRONTEND_DIR="$DEPLOY_DIR/b0esche_cloud"
|
FRONTEND_DIR="$DEPLOY_DIR/b0esche_cloud"
|
||||||
cd "$FRONTEND_DIR"
|
cd "$FRONTEND_DIR"
|
||||||
|
# Ensure a clean build environment to avoid stale package config or .dart_tool cache
|
||||||
|
sudo -u admin rm -rf .dart_tool build
|
||||||
|
# Fetch packages and clean previous artifacts
|
||||||
|
timeout 300 sudo -u admin /opt/flutter/bin/flutter pub get
|
||||||
|
sudo -u admin /opt/flutter/bin/flutter clean
|
||||||
|
# Now build
|
||||||
timeout 900 sudo -u admin /opt/flutter/bin/flutter build web --release || {
|
timeout 900 sudo -u admin /opt/flutter/bin/flutter build web --release || {
|
||||||
echo "Flutter build failed or timed out"
|
echo "Flutter build failed or timed out"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user