-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·49 lines (46 loc) · 1.37 KB
/
setup.sh
File metadata and controls
executable file
·49 lines (46 loc) · 1.37 KB
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
44
45
46
47
48
49
#!/bin/bash
# Define the usage message
usage() {
echo "Usage: $0 {start|stop|gatling|local|logs}"
echo " start : Runs 'docker-compose up' to start all services (db and gatling-backend)."
echo " stop : Runs 'docker-compose down --remove-orphans' to stop all services and remove orphans."
echo " gatling: Runs Gatling to test the service under pressure."
echo " local : Runs only the 'db' service and starting the 'gatling-backend' locally."
echo " logs : Get logs from the gatling-backend"
exit 1
}
# Check the number of arguments
if [ "$#" -ne 1 ]; then
usage
fi
# Execute based on the argument
case "$1" in
start)
echo "Starting Docker Compose services (db and gatling-backend)..."
docker-compose down --remove-orphans
docker-compose up -d
;;
stop)
echo "Stopping Docker Compose services and removing orphans..."
docker-compose down --remove-orphans
;;
gatling)
echo "Starting Gatling"
cd gatling
mvn gatling:test
;;
local)
echo "Starting only the 'db' service..."
docker-compose down --remove-orphans
docker-compose up -d db
cd gatling-backend
mvn spring-boot:run
;;
logs)
docker-compose logs gatling-backend
;;
*)
echo "Invalid parameter."
usage
;;
esac