-
Notifications
You must be signed in to change notification settings - Fork 0
/
stopMicroservices.sh
43 lines (41 loc) · 1.1 KB
/
stopMicroservices.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
43
#!/bin/bash
# Array of directories containing microservices
directories=(
"./bookService"
"./gatewayService"
"./socialService"
"./userService"
# Add more directories as needed
)
echo "What You use local-compose ? [Y/n] 🌀 "
read REPLY
echo $REPLY
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "==========================="
echo "Stoping microservices with local-compose.yml"
for dir in "${directories[@]}"
do
echo "Stoping microservices in directory: $dir"
cd "$dir"
pwd
docker-compose -f local-compose.yml down
echo "==========================="
echo "Docker-compose exited with status $?"
cd ..
done
else
echo "==========================="
echo "Stoping microservices with docker-compose.yml"
for dir in "${directories[@]}"
do
echo "Stoping microservices in directory: $dir"
cd "$dir"
pwd
docker-compose down
echo "==========================="
echo "Docker-compose exited with status $?"
cd ..
done
fi
echo "==========================="