From a967ad37778dbda8515065ec17767467a71a489b Mon Sep 17 00:00:00 2001 From: Om Mishra <32200996+mishraomp@users.noreply.github.com> Date: Fri, 20 Dec 2024 15:44:18 -0800 Subject: [PATCH] chore: add timer to flyway job (#23) * chore: adding timestamp to logs --- infrastructure/api/ecs.tf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/infrastructure/api/ecs.tf b/infrastructure/api/ecs.tf index 7ccf785d..9a6e9113 100644 --- a/infrastructure/api/ecs.tf +++ b/infrastructure/api/ecs.tf @@ -106,7 +106,15 @@ resource "aws_ecs_task_definition" "flyway_task" { --query 'tasks[0].taskArn' \ --output text) + echo "Flyway task started with ARN: $task_arn at $(date)." + + echo "Waiting for Flyway task to complete..." aws ecs wait tasks-stopped --cluster ${aws_ecs_cluster.ecs_cluster.id} --tasks $task_arn + + echo "Flyway task completed, at $(date)." + + task_status=$(aws ecs describe-tasks --cluster ${aws_ecs_cluster.ecs_cluster.id} --tasks $task_arn --query 'tasks[0].lastStatus' --output text) + echo "Flyway task status: $task_status at $(date)." EOF } }