summaryrefslogtreecommitdiff
path: root/microservices
diff options
context:
space:
mode:
authorKamal Wickramanayake <kamal@inbox.lk>2026-07-05 21:26:54 +0530
committerKamal Wickramanayake <kamal@inbox.lk>2026-07-05 21:26:54 +0530
commit5287a9a10507c998540ac51442ff451a280dc05c (patch)
tree98508b5a4394246f400c1e892875d6372a77f19a /microservices
parente45f71793ec4911094f2c3e42953e307887b3bff (diff)
Microservices: Added start-all.sh file
Diffstat (limited to 'microservices')
-rwxr-xr-xmicroservices/start-all.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/microservices/start-all.sh b/microservices/start-all.sh
new file mode 100755
index 0000000..d00c79a
--- /dev/null
+++ b/microservices/start-all.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+echo Starting the authorization server, API gateway, resourece server, Vite dev server...
+
+# 1. Clean up background tasks on CTRL+C (SIGINT) or script exit
+cleanup() {
+ echo " Catching CTRL+C. Terminating background jobs..."
+ # Kill all child processes of this script
+ pkill -P $$
+ exit 1
+}
+
+# 2. Assign the cleanup function to the INT signal
+trap cleanup INT
+
+# 3. Start your background commands using '&'
+echo "Starting tasks..."
+
+cd 01-oauth2-server
+./mvnw spring-boot:run &
+# Wait a few seconds until authorization server starts
+sleep 10
+
+cd ../02-api-gateway
+./mvnw spring-boot:run &
+
+cd ../03-resource-server
+./mvnw spring-boot:run &
+
+sleep 10
+cd ../04-react-app
+npm run dev
+
+# 4. Wait for all background processes to finish
+wait