I have a CodePipeline setup. But now I want to only have my Pipeline run when I trigger it manually, is that possible?
-
wondering a similar thing, did the answer below work for you? – fuzzi Feb 19 '19 at 19:43
-
1@fuzzi, I believe thats possible, tho for me, I added an approval step. Btw, now you can disable transitions https://docs.aws.amazon.com/codepipeline/latest/userguide/transitions.html – Jiew Meng Feb 22 '19 at 14:44
3 Answers
This worked for me:
Set up a regular pipeline with Github webhook set. This will create and register an internal aws webhook. Then simply deregister and remove the webhooks like it is written in the aws docs via aws-cli.
Adjust the following to your region, mine is us-east-2:
Find out the name of the webhook:
aws codepipeline list-webhooks
De-register:
aws codepipeline deregister-webhook-with-third-party --webhook-name <webhook-name>
Delete:
aws codepipeline delete-webhook --name <webhook-name>
Note: It's necessary to have the source step configured to use the Github webhook.
Now you can trigger your pipeline manually via AWS Console or via aws-cli with:
aws codepipeline start-pipeline-execution --name <pipeline-name>

- 512
- 1
- 5
- 15
-
1Yea, this worked, like a charm! It should be the correct answer!. Just the `--endpoint-url` and `--region` are not necessary, they don't exist in the new API. `aws codepipeline list-webhooks` is enough. Once again, thanks! – Matteo May 16 '20 at 02:32
You need configure your CodePipeline to be triggered by CloudWatch event. Once you've done that, an event rule under CloudWatch named "codepipeline-{repository_name}" will be created.
Disabling this rule will stop CodePipeline from been triggered by CodeCommit. When you need a build, just click 'Release Change' button.

- 29
- 4
You can use CloudWatch Events, to never trigger your pipeline:
Set up a cronjob that will never execute, and then you can manually trigger the pipeline whenever you want by clicking on the 'Release change' button. I haven't tested, but I think it should work.

- 2,636
- 1
- 28
- 42