'How to call actuator health endpoint from screwdriver yml file to check container health?

I am having a gradle based spring boot project with screwdriver as CI/CD tool. The CI jobs are specified using templates. I have the requirement of testing the docker container health while PR build. I am thinking of following approach :

  1. Build the docker image
  2. Run the docker container on build server
  3. Calling the actuator health endpoint
  4. Stopping the container
  5. Return response based on step 3 result

With this approach, I am trying to figure out if there is a way through which I can actually catch the response of api call and then act accordingly.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source