gpt4 book ai didi

docker - CI/CD用于新的ECS任务定义

转载 作者:行者123 更新时间:2023-12-02 19:21:54 28 4
gpt4 key购买 nike

我有Jenkins管道来构建spring boot应用程序的docker镜像并将其推送到AWS ECR。我们创建了ECS集群,该集群从ECR存储库中获取该镜像并使用ECS任务和服务运行容器。

我们手动创建了ECS集群。但是现在我希望每当我的CICD将新镜像推送到ECR存储库时,都应该获取新镜像并创建新的任务定义并自动运行。实现此目的的方法是什么?

最佳答案

But now i want whenever a new image is pushed by my CICD to ECR repository it should take the new image and create new task definition and run automatically.What are the ways to achieve this ?



就此步骤而言,使用 code pipeline更容易,因为Jenkins中没有开箱即用的功能可以检测ECR图像的变化。

The completed pipeline detects changes to your image, which is stored in the Amazon ECR image repository, and uses CodeDeploy to route and deploy traffic to an Amazon ECS cluster and load balancer. CodeDeploy uses a listener to reroute traffic to the port of the updated container specified in the AppSpec file. The pipeline is also configured to use a CodeCommit source location where your Amazon ECS task definition is stored. In this tutorial, you configure each of these AWS resources and then create your pipeline with stages that contain actions for each resource.



enter image description here

tutorials-ecs-ecr-codedeploy

build-a-continuous-delivery-pipeline-for-your-container-images-with-amazon-ecr-as-source

如果您在 Jenkins (Jenkins)寻找此东西,那么您必须在最后处理这些东西。

这将是步骤
  • 将图像推送到ECR
  • 在您的 Jenkins 作业using aws-cli或具有相同图像名
  • ecs-cli中重复使用图像名称和“创建任务”定义
    带有新任务定义的
  • Create servicei

  • 您可以在此处查找详细信息

    set-up-a-build-pipeline-with-jenkins-and-amazon-ecs

    关于docker - CI/CD用于新的ECS任务定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59044071/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com