This document is a guide to setting up a webhook for CI jobs or Pipelines in Gearset, that deploys changes from an AWS CodeCommit repository when the source branch changes.
Prerequisites before setting up CodeCommit webhooks:
You have added a repository connection for AWS CodeCommit (see our guide on Integrating with AWS CodeCommit).
The AWS CodeCommit repository you are connecting to is not blank and that there is at least one branch (e.g. Main) to work with; otherwise, you will get an error when you select the
Source repositoryfield on the CIAdd new deployment jobpage.
For all CI jobs you will need:
1 SNS Topic and Subscription
1 Eventbridge Rule
1 Trigger
Creating a CI job in Gearset
These steps will let you know how to create a CI job in Gearset. If you've already created a CI job, select Webhook setup in the CI job menu:
Note down your Payload URL and Shared secret, and proceed with the next step in the article to add your webhook.
To get started, from the Continuous integration page in Gearset, click
Add new deployment joborAdd new team-shared deployment job.Select
AWS CodeCommitas theSource type.Under
Deployment behavior, selectwhen the source branch is updated.
Configure the other options, click Save, and you will see another dialog box with the webhook information in it. Next, save the Payload URL and Shared secret for use later on to create and configure your CodeCommit webhooks.
Adding a Webhook
In the AWS Management Console, go to the
Amazon SNSsection and searchSimple Notification Service.Create a
new topic, then create anew subscriptionfor that topic.Choose a name for your topic, and set its type as
standard.Set
ProtocoltoHTTPS.Set the
Endpointto thePayload URLyou have saved from Gearset’s webhook setup dialog earlier.The new subscription’s ID will be
Pending confirmation.Click
Request confirmationsand hitrefreshin the table. The subscription should then be assigned a proper subscription ID.In the AWS Management Console, go to
AWS CodeCommit.For the repository you’re deploying, go to
Settings, and then toTriggers.Click
Create new trigger.Under
Events, selectPush to existing branch.Do not select any branches under
Brach namesso the webhook works for all branches in your pipeline.Select the
SNS topicyou created earlier.Under
Custom data, paste in theShared secretfrom Gearset’s webhook setup dialog earlier.
You can click Test trigger to confirm it can connect successfully. The next time you push to this branch, it will trigger the CI job in Gearset.
Setting up an EventBridge rule
Your CI job webhook will need an EventBridge rule to function correctly. After you've created your CI job webhook, please refer to our guide on EventBridge configuration for AWS CodeCommit.





