Sasha Shpota
Sasha Shpota

Reputation: 10290

AWS: How to specify files changes to which would trigger CodePipleine build?

I have a monorepo containing several sub-projects (microservices) stored on GitHub. I am trying to build it using the combination of AWS CodePipeline and CodeBuild. I would like to start pipelines depending on what sub-project has been changed. For example, if a file in a service-1 folder is changed I want to run a service-1 pipeline, and I don't want to run build for service-2 or service-3.

In Google Cloud Build, there is a possibility to specify "included files" and "ignored files". I am trying to find exactly the same thing in AWS.

Quastion: How to specify files/folders changes to which would trigger a CodePipleine build?

Upvotes: 1

Views: 1370

Answers (1)

LRutten
LRutten

Reputation: 1902

Like with many services in AWS, you'd have to build this yourself. There is a blogpost on how to customize triggers. It roughly consists of the following:

  1. Create a CW event rule that triggers a lambda on codecommit repo updates.
  2. Write the logic that suits your usecase in the abovementioned lambda
  3. The lambda eventually emits a custom CW event
  4. Configure your pipelines to trigger based on the custom event payload

Article can be found at: https://aws.amazon.com/blogs/devops/adding-custom-logic-to-aws-codepipeline-with-aws-lambda-and-amazon-cloudwatch-events/

Upvotes: 2

Related Questions