So, I have a deployment shell script — obviously for the purpose of deploying the built jar in the server. The shell script will have steps to deploy the application like — stop current service, replace jar and start latest.
But you also may need to send a notification or need to understand if the app is up after you have deployed the latest. I’m using a spring-boot application and enabled actuator end point (/actuator/health).
So, you can call the api for some seconds or minutes until the app goes live. When the api returns success, that means the application is up. Below is the script that could be used.