-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
32 lines (24 loc) · 798 Bytes
/
setup.sh
File metadata and controls
32 lines (24 loc) · 798 Bytes
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
#!/bin/bash
# Install prerequisites
sudo yum update -y
sudo yum install git -y
sudo yum install java-17-openjdk -y
sudo yum install maven -y
# Set environment variable for DB password
export DB_PASSWORD=ufc-database-conor-2025
# Clone your repo (if not already cloned)
if [ ! -d "UFC-Insight" ]; then
git clone https://github.com/FranThe3rd/UFC-Insight.git
fi
cd UFC-Insight/backend
# Clean and build the project
mvn clean package
# Kill any process currently using port 8080
PID=$(sudo lsof -t -i :8080)
if [ ! -z "$PID" ]; then
echo "Killing existing process on port 8080: $PID"
sudo kill -9 $PID
fi
# Run Spring Boot in the background with logs
nohup mvn spring-boot:run > nohup.out 2>&1 &
echo "Spring Boot backend is starting... Logs can be viewed with: tail -f nohup.out"