generated from arafkarsh/ms-springboot-324-java-22-jakarta-ee-10
-
Notifications
You must be signed in to change notification settings - Fork 4
/
run
executable file
·20 lines (18 loc) · 873 Bytes
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# -------------------------------------------------------------------------------------------
# @author: Araf Karsh Hamid
# -------------------------------------------------------------------------------------------
echo "Starting `getServiceName` Microservice"
export JDK_JAVA_OPTIONS="--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED"
runMode=$1
# Check if the runMode is null or not one of "dev", "prod", or "staging"
if [[ -z $runMode || ($runMode != "dev" && $runMode != "prod" && $runMode != "staging") ]]
then
runMode="dev"
fi
echo "App running with profile = $runMode"
# Run Maven Command
# mvn spring-boot:run -Dspring-boot.run.profiles=$runMode
# Run Java command
echo "java -jar target/ai-service-*-spring-boot.jar --spring.profiles.active=$runMode"
java -jar target/ai-service-*-spring-boot.jar --spring.profiles.active=$runMode