34 lines
677 B
Bash
Executable File
34 lines
677 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Script to deploy the VoxPop frontend
|
|
|
|
# Exit on any error
|
|
set -e
|
|
|
|
# Set variables
|
|
ENV=${1:-development}
|
|
PROJECT_ROOT=$(dirname "$(dirname "$(realpath "$0")")")
|
|
FRONTEND_DIR="$PROJECT_ROOT/frontend"
|
|
|
|
echo "Deploying VoxPop frontend in $ENV environment..."
|
|
|
|
# Navigate to frontend directory
|
|
cd "$FRONTEND_DIR"
|
|
|
|
# Install dependencies
|
|
echo "Installing dependencies..."
|
|
npm install
|
|
|
|
# Build the application
|
|
echo "Building frontend application..."
|
|
npm run build
|
|
|
|
if [ "$ENV" = "production" ]; then
|
|
echo "Starting production server..."
|
|
npm run start
|
|
else
|
|
echo "Starting development server..."
|
|
npm run dev
|
|
fi
|
|
|
|
echo "Frontend deployment completed successfully!" |