简体   繁体   English

aws codepipeline / 在新提交上取消当前正在运行的管道

[英]aws codepipeline / cancel currently running pipeline on new commits

new to codepipeline;新的代码管道;

user A pushes, pipeline `run A` is starting.  

1 min. later, user B pushes, `run A` in progress, \
new pipeline `run B` is stacked pending, until `run A` is done.

Is it possible to configure things, so that, a running pipeline is automatically cancelled when a new run (commit) is stacked?是否可以进行配置,以便在堆叠新的运行(提交)时自动取消正在运行的管道?

'Translating' the example above: : “翻译”上面的例子:

user A pushes, pipeline `run A` is starting.  

1 min. later, user B pushes, `run A` is cancelled,
`run B` starts right away

TL;DR CodePipeline does not have out-of-the-box execution interruption, but you could implement it yourself. TL;DR CodePipeline 没有开箱即用的执行中断,但您可以自己实现它。

Pipeline executions work by applying three rules: 管道执行通过应用三个规则来工作

  1. Stages are locked when an execution is being processed正在处理执行时,阶段被锁定
  2. Subsequent executions wait for the stage to be unlocked后续执行等待阶段解锁
  3. Waiting executions are superseded by more recent executions等待处决被最近的处决所取代

Executions patiently wait their turn.处决者耐心地等待轮到他们。 The CLI and SDK have APIs to stop an execution and get info about executions . CLI 和 SDK 具有 API 来停止执行获取有关执行的信息 You could implement execution interruptions yourself by running some business logic using these APIs at the start of each new execution.您可以通过在每次新执行开始时使用这些 API 运行一些业务逻辑来自己实现执行中断。

Could, but should?可以,但应该? A 1:1 correspondence between commit and successful pipeline execution ensures you have a clean, tested rollback state at all times.提交和成功的管道执行之间的 1:1 对应关系可确保您始终拥有干净、经过测试的回滚 state。

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

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