nxtgauge-backend-rust/start-services.sh

46 lines
1.4 KiB
Bash
Raw Normal View History

#!/bin/bash
set -e
set -a
source .env
set +a
echo "Building workspace..."
cargo build --workspace
echo "Stopping any previously running services..."
pkill -f "target/debug/gateway" || true
pkill -f "target/debug/users" || true
pkill -f "target/debug/companies" || true
pkill -f "target/debug/job_seekers" || true
pkill -f "target/debug/customers" || true
pkill -f "target/debug/photographers" || true
pkill -f "target/debug/makeup_artists" || true
pkill -f "target/debug/tutors" || true
pkill -f "target/debug/developers" || true
pkill -f "target/debug/video_editors" || true
pkill -f "target/debug/graphic_designers" || true
pkill -f "target/debug/social_media_managers" || true
pkill -f "target/debug/fitness_trainers" || true
pkill -f "target/debug/catering_services" || true
2026-04-06 01:47:10 +02:00
pkill -f "target/debug/ugc_content_creators" || true
pkill -f "target/debug/employees" || true
apps=(
"gateway" "users" "companies" "job_seekers" "customers"
"photographers" "makeup_artists" "tutors" "developers" "video_editors"
2026-04-06 01:47:10 +02:00
"graphic_designers" "social_media_managers" "fitness_trainers" "catering_services"
"ugc_content_creators" "employees"
)
for app in "${apps[@]}"; do
2026-04-06 01:47:10 +02:00
if [[ -x "./target/debug/$app" ]]; then
echo "Starting $app..."
nohup ./target/debug/$app > "$app.log" 2>&1 &
else
echo "Skipping $app (binary not found at ./target/debug/$app)"
fi
done
2026-04-06 01:47:10 +02:00
echo "All available services booted up!"