-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·53 lines (43 loc) · 1.41 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·53 lines (43 loc) · 1.41 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
#!/bin/bash
# Sorting Office Build Script
# This script helps set up and build the Sorting Office mail server admin tool
set -e
echo "🚀 Sorting Office Build Script"
echo "================================"
# Check if Rust is installed
if ! command -v cargo &> /dev/null; then
echo "❌ Rust/Cargo not found. Please install Rust first:"
echo " https://rustup.rs/"
exit 1
fi
# Check if Diesel CLI is installed
if ! command -v diesel &> /dev/null; then
echo "📦 Installing Diesel CLI..."
cargo install diesel_cli --no-default-features --features mysql
fi
# Check if .env file exists
if [ ! -f .env ]; then
echo "📝 Creating .env file from template..."
cp env.example .env
echo "⚠️ Please edit .env file with your database credentials before continuing"
echo " DATABASE_URL=mysql://username:password@localhost/sortingoffice"
read -p "Press Enter when you've configured .env..."
fi
# Build the project
echo "🔨 Building project..."
cargo build --release
# Run database setup
echo "🗄️ Setting up database..."
diesel setup
# Run migrations
echo "📊 Running database migrations..."
diesel migration run
echo "✅ Build complete!"
echo ""
echo "To run the application:"
echo " cargo run"
echo ""
echo "The application will be available at: http://localhost:3000"
echo "Default login: admin/admin"
echo ""
echo "⚠️ Remember to change the default credentials in production!"