forked from engineering-do-brasil/desafio-devops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·36 lines (31 loc) · 939 Bytes
/
run.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
#!/bin/bash
echo "[=============================]"
echo "[ Running docker-compose.yaml ]"
echo "[=============================]"
docker compose up -d
printf "\n\n\n"
sleep 2
echo "[===============================]"
echo "[ Showing the container running ]"
echo "[===============================]"
docker ps
printf "\n\n\n"
sleep 2
echo "[===========================================]"
echo "[ Making a request to application with curl ]"
echo "[===========================================]"
curl http://127.0.0.1/
printf "\n\n\n"
sleep 2
echo "[=======================================]"
read -p "[ Do you wanna stop it? Enter y or n: " answer
echo "[=======================================]"
printf "\n\n\n"
if test $answer == 'y' || test $answer == 'Y'
then
sleep 1
echo "[==============================]"
echo "[ Stopping docker-compose.yaml ]"
echo "[==============================]"
docker compose down
fi