This document is a guide on how to create a webhook trigger to trigger a CI job in Gearset each time pushes are made to a branch. To trigger validations when pull requests are opened against that branch, you will additionally need to follow this guide to set up an EventBridge rule.
Instructions
In the AWS Management Console, go to the SNS section (searching for 'Simple Notification Service' at the top)
Create a new topic, then create a new subscription for that topic.
Select
HTTPS
as theProtocol
.Set the
Endpoint
to thePayload URL
from Gearset’s webhook setup dialog earlier.The new subscription’s ID will be
Pending confirmation
.Click the
Request confirmations
button and hit the refresh button in the table. The subscription should then be assigned a proper subscription ID.In the AWS Management Console, go to the
AWS CodeCommit
section.For the repository you’re deploying, go to the
Settings
section, and then to theTriggers
tab.Click the
Create new trigger
button.Under
Events
, selectPush to existing branch.
Under
Branch names
, select the branch (or just leave it blank if you want to select all branches).Under
SNS topic
, select the SNS topic you created earlier.Under
Custom data
, paste in theShared secret
from Gearset’s webhook setup dialog earlier.
You can test the trigger at this point to check that it can connect successfully.
Now the next time you push to this branch, it will trigger the CI job in Gearset.
How to set up validations against an opened PR
If you want validations to be triggered when opening a PR against that branch, you would also need to conduct additional steps by creating an EventBridge Rule. The steps to add these for CI jobs are documented under EventBridge configuration for the users using AWS CodeCommit.