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.
In summary, per CI job configured to instigate a specific action, you will need the following set up on the AWS side:
1 Simple Notification Service (SNS) Topic
1 EventBridge rule (optional - for forward-looking validations when opening a PR)
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.
Before performing the steps listed below, you need to ensure that the AWS code commit repository is not blank and has at least one branch (for e.g. main) to work with, otherwise, you will get an error when you select the Source repository field on the Add CI deployment job page.
To get started, from the Continuous integration page in Gearset, click
ADD NEW JOB....
AWS CodeCommitas the
Run job, select
when the source branch is updated.
Once you’ve configured the other options, click
Saveand you’ll see another dialog box with the webhook information in it. You’ll need the
Shared secretlater on, so keep them around.
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.
Payload URLfrom Gearset’s webhook setup dialog earlier.
The new subscription’s ID will be
Request confirmationsbutton 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
For the repository you’re deploying, go to the
Settingssection, and then to the
Create new triggerbutton.
Push to existing branch.
Branch names, select the
All branches(or just the branch name you want to trigger the CI job with).
SNS topic, select the SNS topic you created earlier.
Custom data, paste in the
Shared secretfrom 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.
If you then wanted validations to be triggered when opening a PR against that branch, you would also need to conduct additional steps by creating an EventBridge Rule. These steps are documented under EventBridge configuration for the users using AWS CodeCommit.