-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathconductor-setup.sh
More file actions
executable file
·85 lines (69 loc) · 2.53 KB
/
Copy pathconductor-setup.sh
File metadata and controls
executable file
·85 lines (69 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
set -euo pipefail
# Conductor Setup Script for Points Project
# This script sets up a new workspace with all necessary dependencies and configurations
# Default so `set -u` doesn't abort when run outside Conductor (var is Conductor-only)
CONDUCTOR_ROOT_PATH="${CONDUCTOR_ROOT_PATH:-}"
echo "🚀 Setting up Points workspace..."
# Check for required tools
echo "📋 Checking prerequisites..."
if ! command -v python3 &> /dev/null; then
echo "❌ Error: Python 3 is not installed. Please install Python 3.8+ first."
exit 1
fi
if ! command -v npm &> /dev/null; then
echo "❌ Error: npm is not installed. Please install Node.js 16+ first."
exit 1
fi
# Backend Setup
echo "🔧 Setting up backend..."
cd backend
# Create virtual environment
echo " Creating Python virtual environment..."
python3 -m venv env
# Activate virtual environment
source env/bin/activate
# Install Python dependencies
echo " Installing Python packages..."
pip install --quiet --upgrade pip
pip install --quiet -r requirements.txt
# Require system Node.js (nodeenv fallback removed)
if command -v node &> /dev/null; then
echo " Using system Node.js ($(node -v))..."
else
echo " ❌ Node.js not found. Install Node.js (https://nodejs.org) and re-run setup."
exit 1
fi
# Copy environment file if it exists in root
if [ -n "$CONDUCTOR_ROOT_PATH" ] && [ -f "$CONDUCTOR_ROOT_PATH/backend/.env" ]; then
echo " Copying backend .env file..."
cp "$CONDUCTOR_ROOT_PATH/backend/.env" .env
elif [ -f ".env.example" ]; then
echo " Creating .env from .env.example..."
cp .env.example .env
echo " ⚠️ Please update backend/.env with your actual configuration values"
fi
# Run database migrations
echo " Running database migrations..."
python manage.py migrate --noinput
# Frontend Setup
echo "🎨 Setting up frontend..."
cd ../frontend
# Install frontend dependencies
echo " Installing npm packages..."
npm install --silent
# Copy frontend environment file if it exists
if [ -n "$CONDUCTOR_ROOT_PATH" ] && [ -f "$CONDUCTOR_ROOT_PATH/frontend/.env" ]; then
echo " Copying frontend .env file..."
cp "$CONDUCTOR_ROOT_PATH/frontend/.env" .env
elif [ -f ".env.example" ]; then
echo " Creating .env from .env.example..."
cp .env.example .env
echo " ⚠️ Please update frontend/.env with your actual configuration values"
fi
echo "✅ Workspace setup complete!"
echo ""
echo "📝 Next steps:"
echo " 1. Review and update any .env files if needed"
echo " 2. Click the 'Run' button to start the development servers"
echo ""