Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github monorepo as source for AWS CodePipeline

We use the monorepo approach for storing our source in github.

Is it currently possible to have CodePipeline trigger only on a commit to a particular subfolder.

This is something that is currently possible with TeamCity by setting a filter on the Source Repository but I've seen no example of this with CodePipeline.

like image 856
Grant Trevor Avatar asked Oct 09 '17 22:10

Grant Trevor


People also ask

How do I manually trigger AWS CodePipeline?

Start a pipeline manually (console)Sign in to the AWS Management Console and open the CodePipeline console at http://console.aws.amazon.com/codesuite/codepipeline/home . In Name, choose the name of the pipeline you want to start. On the pipeline details page, choose Release change.

How do I set environment variables in CodePipeline?

Choose the icon to edit your CodeBuild action. On the Edit action page, under Environment variables, enter the following: In Name, enter a name for your environment variable. In Value, enter the variable syntax for your pipeline output variable, which includes the namespace assigned to your source action.

What is difference between Jenkins and AWS CodePipeline?

Jenkins and AWS CodePipeline are both easy to use and set up. Jenkins installation is straightforward and can be completed in minutes. AWS provides templates that rely on CodeBuild and CodeDeploy to start creating your pipelines.


2 Answers

We worked on exactly that issue. In short: It's possible with a little work around. You can set up a GitHub Webhook as source for a single AWS CodeBuild project. The project allows you to configure filters (file paths) on events pushed to that Webhook. Additionally, you add an S3 bucket and push the code referenced by the filtered event to that bucket. The bucket can be included as source stage for your CodePipeline.

We have documented our solution in a blog post: https://blog.codecentric.de/en/2019/05/codebuild-trigger-pipeline/

like image 93
Marco Berger Avatar answered Sep 19 '22 12:09

Marco Berger


Looks like you answered your own question ;). The answer is not yet, but as a workaround, you can parse the list of changed files and derive the list of changed subfolders from that: https://forums.aws.amazon.com/thread.jspa?messageID=811027&#811027/.

like image 22
skeller88 Avatar answered Sep 18 '22 12:09

skeller88