- 최신
- 최다 투표
- 가장 많은 댓글
Hey samkit-juvoxa
Thank you for your question on how to dynamically update your project using Codebuild with multiple GitHub Repositories.
I have replicated your use case in my own environment using AWS CodePipeline and configured it using two GitHub repositories as sources which dynamically triggered Codebuild. Below are the steps I took.
Currently this feature update your Build Project using CodeBuild with multiple GitHub resources to automatically trigger CodeBuild isn't an available feature that CodeBuild provides. However Integrating your CodeBuild project into CodePipeline with fix this problem.
Here you can find how CodePipeline integrates with CodeBuild to use multiple input sources as outlined in your use case [1] .
-
First create two separate GitHub repositories in an account with different source code in each.
-
Then configure a CodeBuild project with a name and a buildspec that outputs the source code in a giving directory [2].
-
Next continue to the CodePipeline Console and create a pipeline . Configure the source page and select GitHub as the source provider, which prompted a sign in, in order to authorize application access to the account. When the account is authorized this may you chose your GitHub repository for the source location for your pipeline, along with the branch . [3]
-
Then configure the Build section , you should chose CodeBuild and from here chose the Build Project you created in step 2.
-
You should chose to skip the deploy stage, as this step was is necessary for the pipeline.
-
When the build is complete, you can edit the source section of the Pipeline, to add a “new stage”. Here you will prompted to sign into GitHub. When authorized choose add source and pick the second repository you've created and save.
When commits are made to either of the GitHub repositories they will automatically trigger the Pipeline which your CodeBuild project is associated to.
Please feel free to reach out to me with any questions or concerns .
James
[1] https://docs.aws.amazon.com/codebuild/latest/userguide/sample-pipeline-multi-input-output.html
[2] https://docs.aws.amazon.com/codebuild/latest/userguide/getting-started-create-build-project-console.html
[3] https://console.aws.amazon.com/codesuite/codepipeline/start?region=us-east-1