I have a AWS CodePipeline with two deployment stages:
First deployment stage (test one) has container with entry point which executes tests.
My problem is that I'd like to proceed to second deployment stage only if first (test) fargate task has finished all proccesses in containers and stopped them.
So far I've tried moving first ECS Fargate task's launch to buildspec.yml with command 'aws ecs run-task', which gets up, does the job and then kills itself, which is behaviour that is needed. However I'd like to stop whole pipeline until tests are not finished.
This article says you can deploy your containers on the build machine itself using docker-compose as a prebuild
action, then in build
action run the test runner command (npm test). This should fail the deploy test
stage if the tests fail and pass if the tests pass and then let the pipeline continue.