John Thomas
John Thomas

Reputation: 222

How to integrate a GIT webhook with AWS CodePipeline?

Can give me some input on configuring AWS CodePipeline to trigger a ZipDownload or a Git pull if the developer commits a code into the Git branch ? I'm new to AWS CodePipeline and AWS Lamba.

Upvotes: 1

Views: 2130

Answers (2)

Sean Summers
Sean Summers

Reputation: 2694

For CodePipeline to subscribe to a GitHub repo (using the console):

  1. Create a Source Action of "GitHub", and choose your Repo. Choose an Output artifact name that you will remember for the next step. Under advanced, select "Run pipeline when changes in source content are detected".
  2. Create a Build Action using the build provider of your choice. Choose the Input artifact name you chose in step #1.

When a change occurs in the GitHub repo, CodePipeline will execute the Source action, which will build a zip of the repo as is, and put it in an S3 bucket as an Output artifact. It will then pass this file's S3 name into the Build action (using the variable name given in the steps above), so that the zip file can be downloaded and built.

If you have a working buildspec.yml in the root of the repo, you can use the AWS CodeBuild provider, and the artifacts will be copied to the output bucket when done.

Upvotes: 2

Wei Wang
Wei Wang

Reputation: 1

CodePipeline is supposed to manage automation from source code to final deployment, which embrace the concept of continuous integration. Though how to use CodePipeline depends on use case, CodePipeline does source code download for you by detecting source change. Which means what you should thinking about is what to do next after pushing the code, such as run a build action or test action.

It's worth to follow the tutorial to build a pipeline and learn how it works: Tutorial: Create a Simple Pipeline (AWS CodeCommit Repository). It may only take half an hour.

Though it's using codecommit, but it works similar as github. For integration with GitHub, there is a blog you may found useful: Integrating Git with AWS CodePipeline

Upvotes: -1

Related Questions