AWS CodeCommit Trigger Plugin
A Jenkins plugin that triggers jobs on repo update events by AWS CodeCommit, through the AWS Simple Queue Service (SQS) and Simple Notification Service (SNS).
The advantage over the original AWS SQS Plugin that this plugin allows subscribing to multiple branches using the same SQS queue, meaning that:
you no longer need to create a SQS queue per CodeCommit repo
an update to the
devbranch will no longer trigger all jobs that subscribe to that CodeCommit repo.
Our Jenkins Wiki Page is located here: https://wiki.jenkins.io/display/JENKINS/AWS+CodeCommit+Trigger+Plugin
Use JIRA to report issues / feature requests
Quick Setup With Terraform
Use the tf-codecommit-sqs module to create your CodeCommit repos created with provided linkage with SQS/SNS.
General steps to config your Amazon Services:
Create a CodeCommit Repo
Open the Repo, create Triggers that will connect to a webhook through Amazon Simple Notification Service (SNS)
Create SNS Topic subscribe to a Simple Queue Service (SQS) queue
Open the SQS queue, do queue actions to subscribe it to SNS Topic
Make sure the AWS Credentials used for this Plugin has Permission to READ(sqs:ReceiveMessage) & DELETE(sqs:DeleteMessage) message from the SQS Queue.
Jenkins System Configuration
Jenkins > Manage Jenkins > Configure Systemon your Jenkins
AWS Code Commit Trigger SQS Plugin
Configure a queue
Select the name of the queue you just created (the list auto-loaded using Access key ID & Secret key)
Select "Standard Aws Credentials" from the list or click on button "Add Credentials" to create one
Click on Test access
You should see a success message as in the screenshot below. If you get an error message make sure you entered the credentials correctly. If you still see errors double check the user, group and permissions you set up on Amazon Web Services.
If you get the error
Unable to find a region via the region provider chain,
create the directory
.aws inside the Jenkins home directory.
Then inside the
.aws directory add the
config file with the following configuration.
[default] output = json region = <region where is your repository>
Jenkins Job Configuration
Jenkins > $job
Scroll down to
Build when a message is published to an SQS queue
Select the queue you created previously
For cost savings, the plugin does not start monitoring a queue until at least one job has been configured to listen to messages from a queue.
You can use the same queue for multiple jobs or you can create a new queue for each job. Keep in mind that monitoring multiple queues will increase the amount of requests your Jenkins will have to send to AWS.
Normally you would use the same queue and topic for multiple jobs, but for billing purposes it may be easier to use multiple queues, especially if you’re running builds on behalf of a customer.
Test your setup
Create your feature branch (
git checkout -b my-new-feature)
Write your code and tests
Ensure all tests still pass (
mvn clean verify -Pit)
Commit your changes (
git commit -am 'Add some feature')
Push to the branch (
git push origin my-new-feature)
Create new pull request
Full text: Apache License