This document is a guide to setting up a CI job in Gearset that deploys changes from an AWS CodeCommit repository whenever the source branch changes.
Before creating a CI job triggered by a webhook, you need to have added a connection to your AWS CodeCommit from the Source control and services page.
To get started, from the Continuous integration page in Gearset, click
ADD NEW JOB...
.Select
AWS CodeCommit
as theSource type
.Under
Run job
, selectwhen the source branch is updated
.Once you’ve configured the other options, click
Save
and you’ll see another dialog box with the webhook information in it. You’ll need thePayload URL
andShared secret
later on, so keep them around.In the AWS Management Console, go to the SNS section.
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 theAll branches
(or just the branch name you want to trigger the CI job with).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.
User would also need to configure additional steps in EventBridge for the CI jobs to trigger upon creating a pull request. These steps are documented under EventBridge configuration for the users using AWS CodeCommit.