简体   繁体   English

AWS CodePipeline:同时运行多个管道

[英]AWS CodePipeline: Running multiple pipelines concurrently

I m trying to setup my CI/CD process with Bitbucket, CodeBuild and CodePipeline.我正在尝试使用Bitbucket、CodeBuild 和 CodePipeline设置我的 CI/CD 流程 So far, I have Webhook on Bitbucket that will run CodeBuild on custom docker image from ECR and upload the artifacts to Amazon S3 bucket which has versions enabled in it.到目前为止,我在 Bitbucket 上安装了 Webhook,它将在来自 ECR 的自定义 docker 映像上运行 CodeBuild,并将工件上传到其中启用了版本的 Amazon S3 存储桶。 The new upload triggers the CodePipeline based on the Cloudwatch event and runs another CodeBuild after Manual approve which makes the deployment on new S3 bucket which is fine till now.新的上传基于 Cloudwatch 事件触发 CodePipeline,并在手动批准后运行另一个 CodeBuild,这使得部署在新的 S3 存储桶上,到目前为止还可以。 The CodePipeline has 3 stages: Source (s3) ,-> Manual Approve -> CodeBuild . CodePipeline 有 3 个阶段: Source (s3) ,-> Manual Approve -> CodeBuild

The problem is: When I tried to push multiple branches/new commits, the first CodeBuild runs and upload artifacts on S3 with different versions as expected.问题是:当我尝试推送多个分支/新提交时,第一个 CodeBuild 运行并按预期在不同版本的 S3 上上传工件。 However, each upload should trigger each CodePipline.但是,每次上传都应触发每个 CodePipline。 If I had made 3 different code push to the Bitbucket Repository, there should be three Pipelines waiting for Manual approval to be deployed.如果我将 3 个不同的代码推送到 Bitbucket 存储库,则应该有三个管道等待手动批准部署。 But this isn't the case.但事实并非如此。

I have three artifacts uploaded in S3 with different VersionID based on the commits:根据提交,我在 S3 中上传了三个具有不同 VersionID 的工件:

1st commit's artifacts VersionID: OKIBabVQQX80aAuARAne8jnClsTpJGXu第一次提交的工件 VersionID: OKIBabVQQX80aAuARAne8jnClsTpJGXu

2nd commit's artifacts VersionID: YNsgp9rodnAx7du1Te1OQD2UO0t5IZc第二次提交的工件 VersionID: YNsgp9rodnAx7du1Te1OQD2UO0t5IZc

3rd commit's artifacts VersionID: VN7pwVS5zpYNTmzJrLbFGKBupogpgtHN第三次提交的工件 VersionID: VN7pwVS5zpYNTmzJrLbFGKBupogpgtHN

In CodePipeline:在代码管道中:

Stage: Manual Approve is waiting for approval which has S3 Source Version: OKIBabVQQX80aAuARAne8jnClsTpJGXu阶段: Manual Approve正在等待批准,其中有 S3 源版本: OKIBabVQQX80aAuARAne8jnClsTpJGXu

Stage: Source is triggered from S3 with VersionID: VN7pwVS5zpYNTmzJrLbFGKBupogpgtHN阶段:从 S3 触发,版本 ID: VN7pwVS5zpYNTmzJrLbFGKBupogpgtHN

Here I am completely missing the 2nd artifacts: (s3 VersionID: YNsgp9rodnAx7du1Te1OQD2UO0t5IZc ) I would expect all three artifacts to trigger the CodePiple one after another so that I can deploy all my 3 push.在这里,我完全错过了第二个工件:(s3 VersionID: YNsgp9rodnAx7du1Te1OQD2UO0t5IZc )我希望所有三个工件都能一个接一个地触发 CodePiple,这样我就可以部署我所有的 3 个推送。

Many many thanks!!!非常感谢!!!

When a pipeline execution starts, it runs a revision through every stage and action in the pipeline.当管道执行开始时,它会在管道中的每个阶段和操作中运行修订。 Start a Pipeline Execution in CodePipeline 在 CodePipeline 中启动管道执行

Code pipeline stage shows the last trigger for particular the stage.代码管道阶段显示特定阶段的最后一个触发器。 In your case you have:在您的情况下,您有:

  • Artifact1 triggered Source and Manual Approve. Artifact1 触发 Source 和 Manual Approve。
  • Artifact2 triggered Source and waiting to trigger Manual Approval. Artifact2 触发 Source 并等待触发 Manual Approval。
  • Artifact3 triggered Source and waiting to trigger Manual Approval. Artifact3 触发 Source 并等待触发 Manual Approval。

Since your Artifact3 comes after Artifact2 - the Source stage shows it (the last trigger).由于您的 Artifact3 出现在 Artifact2 之后 - Source 阶段显示它(最后一个触发器)。 Artifact2 is not shown but still waiting for its turn. Artifact2 没有显示,但仍在等待轮到它。 Once you finish with Artifact1 on Manual Approval stage, the Artifact2 would appear at Manual Approval.在手动批准阶段完成 Artifact1 后,Artifact2 将出现在手动批准阶段。 After it, Artifact3 would go to Manual Approval stage and so on.之后,Artifact3 将进入 Manual Approval 阶段等等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM