How to manage a microservices using bash?

Viewed 38

For testing the application I have to run the six microservices. I created the bash script for this. What I should add to my bash script to chose with processes that should be killed after typing Ctrl + z in the terminal? For example I would like to kill all the dotnet processes. How to deal with the situation when I have to build and run the application after doing a git pull?

#!/bin/bash
echo "/home/dominik/jpk/app/env/dev/ docker compose up"
cd /home/dominik/jpk/app/env/dev/
docker compose up &
echo "/home/dominik/jpk/app/src/Web/ npm start"
cd /home/dominik/jpk/app/src/Web/
npm start &
echo "/home/dominik/jpk/app/src/Services/Ksefix/Xfx.BackgroundTasks/ dotnet run --urls=http://localhost:5500"
cd /home/dominik/jpk/app/src/Services/Ksefix/Xfx.BackgroundTasks/
dotnet run --urls=http://localhost:5500 &
echo "/home/dominik/jpk/app/src/Services/Invoice/Invoice.Api/ dotnet run"
cd /home/dominik/jpk/app/src/Services/Invoice/Invoice.Api/
dotnet run &
echo "/home/dominik/jpk/app/src/Services/Invoice/Invoice.BackgroundTasks/ dotnet run --urls=http://localhost:5200"
cd /home/dominik/jpk/app/src/Services/Invoice/Invoice.BackgroundTasks/
dotnet run --urls=http://localhost:5200 &
echo "/home/dominik/jpk/app/src/Services/Ksefix/app.Api/ dotnet run --urls=https://localhost:44410"
cd /home/dominik/jpk/app/src/Services/Ksefix/app.Api/
dotnet run --urls=https://localhost:44410 &
echo "/home/dominik/jpk/app/src/Services/Ksefix/app.Api/ dotnet run --urls=http://localhost:44409"
cd /home/dominik/jpk/app/src/Services/Ksefix/app.Api/
dotnet run --urls=http://localhost:44409 &
0 Answers
Related