4

I am not able to find a way to stop the auto triggering of the pipeline whenever I push code to bitbucket.

Saurav Prakash
  • 588
  • 1
  • 5
  • 26
  • You can disable `transition` between source stage and the next one. It will still trigger the source stage, but not the other stages. – Marcin Jun 30 '20 at 12:05
  • 2
    I want the pipeline to run automatically based on a cron and disable the auto triggering. – Saurav Prakash Jul 01 '20 at 13:24
  • If you have cloudwatch events setup as part of deployment, but are triggering on commit, you should be able to just update and change the specific rule to trigger on cron instead. – pkarfs Jul 01 '20 at 21:12
  • The code pipeline is usually triggered by the CloudWatch event that is listening to the reference created/updated events in the source repository. You can disable/delete the cloudwatch event associated with your pipeline. That should stop the auto invocation of the pipeline on every commit. – Manu Sharma Jul 07 '20 at 16:48

2 Answers2

0

My assumption is that you want more control over when your pipeline does certain things.

Rather than achieving this through stopping the pipeline from getting triggered, I'd recommend using either stage transitions or manual approvals to achieve this control inside the pipeline.

Stage transitions are better when you want to "turn off" a pipeline and have the latest thing run through when you turn it back on.

Manual approvals are better when you want the version to be locked while waiting for approval so you can run tests without worrying that the version will change.

You mentioned in your comment that you wanted to only run your pipeline at certain times, so a way you could do that is to enable and disable the stage transition after source on a schedule.

https://docs.aws.amazon.com/codepipeline/latest/userguide/transitions.html https://docs.aws.amazon.com/codepipeline/latest/userguide/approvals.html

TimB
  • 1,457
  • 8
  • 10
  • "Rather than achieving this through stopping the pipeline from getting triggered, I'd recommend using either stage transitions or manual approvals to achieve this control inside the pipeline.". Amazing point of view – SeaBiscuit Jul 13 '23 at 08:29
0

You can disable DetectChanges parameter on your Source action as explained here. Extract with the relevant context:

DetectChanges: Controls automatically starting your pipeline when a new commit is made on the configured repository and branch. If unspecified, the default value is true, and the field does not display by default.

This works on Bitbucket, GitHub, and GitHub Enterprise Server actions. I have a CloudFormation template configured with this option and works. Not sure about the same option on AWS console, because I saw that some configurations are only available from CloudFormation or aws cli. As you can read "this field does not display by default".

Gabriel
  • 1,749
  • 1
  • 11
  • 15