scripts
This commit is contained in:
parent
79d01d3ae4
commit
9ed5ac44fb
3 changed files with 1 additions and 23 deletions
1
mnemo_cards_web_v2/.gitignore
vendored
1
mnemo_cards_web_v2/.gitignore
vendored
|
|
@ -30,7 +30,6 @@ migrate_working_dir/
|
||||||
.flutter-plugins-dependencies
|
.flutter-plugins-dependencies
|
||||||
.pub-cache/
|
.pub-cache/
|
||||||
.pub/
|
.pub/
|
||||||
/build/
|
|
||||||
/coverage/
|
/coverage/
|
||||||
|
|
||||||
# Symbolication related
|
# Symbolication related
|
||||||
|
|
|
||||||
|
|
@ -171,10 +171,9 @@ check_build_directory() {
|
||||||
# Function to build Flutter web app for production
|
# Function to build Flutter web app for production
|
||||||
build_flutter_app() {
|
build_flutter_app() {
|
||||||
print_status "Building Flutter web app for production..."
|
print_status "Building Flutter web app for production..."
|
||||||
# Use -O2 optimization and disable wasm to reduce memory usage during compilation
|
|
||||||
flutter build $FLUTTER_BUILD_TARGET $FLUTTER_BUILD_MODE \
|
flutter build $FLUTTER_BUILD_TARGET $FLUTTER_BUILD_MODE \
|
||||||
--dart-define=API_BASE_URL=$API_BASE_URL \
|
--dart-define=API_BASE_URL=$API_BASE_URL \
|
||||||
--dart2js-optimization=O2
|
--dart2js-optimization=O4
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
print_error "Flutter build failed"
|
print_error "Flutter build failed"
|
||||||
|
|
|
||||||
|
|
@ -30,23 +30,6 @@ print_status "Deploying on server..."
|
||||||
ssh "$SERVER_USER@$SERVER_IP" << EOF
|
ssh "$SERVER_USER@$SERVER_IP" << EOF
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Setup swap if needed (helps with memory-intensive operations)
|
|
||||||
$(declare -f setup_swap)
|
|
||||||
$(declare -f remove_swap)
|
|
||||||
$(declare -f print_status)
|
|
||||||
$(declare -f print_warning)
|
|
||||||
$(declare -f print_success)
|
|
||||||
$(declare -f print_info)
|
|
||||||
RED='$RED'
|
|
||||||
GREEN='$GREEN'
|
|
||||||
YELLOW='$YELLOW'
|
|
||||||
BLUE='$BLUE'
|
|
||||||
NC='$NC'
|
|
||||||
setup_swap
|
|
||||||
|
|
||||||
# Trap to ensure swap cleanup on exit
|
|
||||||
trap 'remove_swap' EXIT
|
|
||||||
|
|
||||||
# Create web directory if it doesn't exist
|
# Create web directory if it doesn't exist
|
||||||
mkdir -p $WEB_ROOT
|
mkdir -p $WEB_ROOT
|
||||||
|
|
||||||
|
|
@ -115,9 +98,6 @@ ssh "$SERVER_USER@$SERVER_IP" << EOF
|
||||||
ufw allow $FIREWALL_ALLOW_SSH
|
ufw allow $FIREWALL_ALLOW_SSH
|
||||||
ufw --force enable
|
ufw --force enable
|
||||||
|
|
||||||
# Clean up temporary swap
|
|
||||||
remove_swap
|
|
||||||
|
|
||||||
echo "Deployment completed successfully!"
|
echo "Deployment completed successfully!"
|
||||||
echo "Application is available at: https://memo-cards.online"
|
echo "Application is available at: https://memo-cards.online"
|
||||||
EOF
|
EOF
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue