I have a Bamboo setup that runs some Unit tests that access a set of services. I start those services before Unit Tests run( as a Job) and in case of a Unit Test failure the Job after unit tests (Job 4 below ) which Stop the services are not run.
Is there a way where irrespective of a Build result there can be a tear down called that I can use to stop all services.
Note: All this is being run using a single agent and single stage with multiple jobs in that stage.
Job1 - Start Services
Job2 - Checkout code
Job3 - Run maven clean install
Job4- Shutdown services