我们是否有AWS CLI命令等待ECS服务更新开始新任务?

发布于 2025-02-08 06:59:16 字数 302 浏览 1 评论 0原文

我使用以下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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

战皆罪 2025-02-15 06:59:16

您可以尝试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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文