Skip to content

Added stop-task script to stop ECS service tasks

Etienne Baqué requested to merge 218167-script-for-ecs-review-stop into master

This MR adds a stop_task function to the ecs script. This will be linked to the stop review environment action, made available in this other MR.

When redeploying to ECS, this MR also checks that at least one task is made available in the targeted service before updating the related task definition.

Relates to gitlab#218167 (closed)

Manual testing

Targeted service for review app has no task running:

2020-10-20_11-03

Some code changes:

2020-10-20_11-04

Pipeline running then: https://gitlab.com/ebaque/rails-minimal/-/pipelines/205045303

Screenshot_from_2020-10-20_11-07-41

Deployment successful, new task started, new version of task definition:

2020-10-20_11-10

Deployed app:

Screenshot_from_2020-10-20_11-17-40

Stopping environment: https://gitlab.com/ebaque/rails-minimal/-/pipelines/205045303

Screenshot_from_2020-10-20_11-19-24

Task has stopped:

2020-10-20_11-20

Deployed app is unavailable:

Screenshot_from_2020-10-20_11-21-12

Edited by Etienne Baqué

Merge request reports