-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-integrated.sh
executable file
·42 lines (36 loc) · 1.1 KB
/
build-integrated.sh
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
#!/bin/bash
# Define the working directories
FRONTEND_DIR="./websocket-vue-front"
BACKEND_DIR="./websocket-spring-back"
STATIC_DIR="$BACKEND_DIR/src/main/resources/static"
# Step 1: Clean up the static resources directory
echo "Cleaning up static resources directory..."
if [ -d "$STATIC_DIR" ]; then
# Preserve the .gitkeep file
find "$STATIC_DIR" -type f -not -name ".gitkeep" -delete
find "$STATIC_DIR" -type d -empty -delete
fi
# Step 2: Build the Vue.js frontend
echo "Building Vue.js frontend..."
cd $FRONTEND_DIR
npm run dist
if [ $? -ne 0 ]; then
echo "Frontend build failed"
exit 1
fi
echo "Frontend build successful"
# Step 3: Build the Spring Boot backend
echo "Building Spring Boot backend..."
cd ../$BACKEND_DIR
./mvnw clean package
if [ $? -ne 0 ]; then
echo "Backend build failed"
exit 1
fi
echo "Backend build successful"
# The JAR file will be in the target directory
JAR_FILE=$(find ./target -name "*.jar" -not -name "*sources.jar" -not -name "*javadoc.jar")
echo "Built JAR file: $JAR_FILE"
echo "You can run the integrated application with:"
echo "java -jar $JAR_FILE"
exit 0