我们是否有AWS CLI命令等待ECS服务更新开始新任务?
我使用以下AWS CLI命令来通过Jenkins Job的新任务定义在ECS中更新我的服务。 AWS ECS更新服务 - 群集XYZ -Service ABC -task-definition = ABC.JSON - Force-New-Deployment
此命令正在更新服务并启动新的部署(创建新任务)
现在,我正在寻找AWS CLI命令或詹金斯(Jenkins)作业的一种方式,等到新创建的任务在运行状态。
我尝试执行列表任务,但不确定如何获得描述和提取状态的最新任务。
I am using below aws cli command to update my service in ecs with new task definition from Jenkins job.aws ecs update-service --cluster xyz --service abc --task-definition=abc.json --force-new-deployment
This command is updating the service and starting new deployment (creating new task)
Now, I am looking for aws cli command or a way for my Jenkins job to wait until the newly created task is in RUNNING state.
I have tried to do list-tasks but not sure how to get the latest task to describe and pull status.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试
aws ecs等待服务stable
(文档在这里),它将等待新任务运行,并停止旧任务。You can try
aws ecs wait services-stable
(documentation here) which will wait for new tasks to be running, and old tasks to be stopped.