Skip to content

Commit ab1cc47

Browse files
authored
Add AWS CodeBuild Project (#15)
1 parent d31890c commit ab1cc47

File tree

4 files changed

+154
-49
lines changed

4 files changed

+154
-49
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,25 @@ Example stack name: RenesasPipeline
130130

131131
Expected build time: 27min / rebuild (without any change, just use sstate cache): 9min
132132

133-
---
133+
### A AWS CodeBuild Project
134+
This will create an Embedded Linux ready AWS CodeBuild project that can be used to connect to a source, e.g. [GitHub Actions](https://docs.aws.amazon.com/codebuild/latest/userguide/action-runner.html). This is not using any CodePipeline.
135+
136+
And use the EFS to share downloads and sstate cache between the runners.
137+
138+
The connection to the CodeBuild source must be performed manually.
139+
140+
Also you can clone the CodeBuild project and share the efs between the CodeBuild projects.
141+
142+
See the AWS CodeBuild pipeline: EmbeddedLinuxCodebuildProje-*
143+
144+
To make a source connection to GitHub you need to:
145+
- Select a "Source provider"->"GitHub"
146+
- Select "Primary source webhook events" -> "Webhook - optional" -> "Rebuild every time a code change is pushed to this repository"
147+
- Add "Filter group 1" -> "WORKFLOW_JOB_QUEUED"
148+
- Modify the GitHub action `runs-on: ${{ vars.CODEBUILD_RUNNER_NAME }}-${{ github.run_id }}-${{ github.run_attempt }}`
149+
CODEBUILD_RUNNER_NAME should be `codebuild-EmbeddedLinuxCodebuildProjeNAME` with prefix `codebuild-`. See example [here](https://github.com/aws4embeddedlinux/meta-aws-demos/blob/master/.github/workflows/build-gg.yml).
150+
151+
Example stack name: EmbeddedLinuxCodeBuildProject
134152

135153
## Useful NPM and CDK commands
136154

bin/app.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as cdk from "aws-cdk-lib";
33
import { addDependency } from "aws-cdk-lib/core/lib/deps";
44
import {
55
EmbeddedLinuxPipelineStack,
6+
EmbeddedLinuxCodebuildProjectStack,
67
BuildImageDataStack,
78
BuildImagePipelineStack,
89
BuildImageRepoStack,
@@ -199,3 +200,15 @@ const nxpImxPipeline = new EmbeddedLinuxPipelineStack(app, "NxpImxPipeline", {
199200
subDirectoryName: "NxpImxPipeline",
200201
});
201202
nxpImxPipeline.addDependency(buildImagePipeline)
203+
204+
/**
205+
* Create an Embedded Linux Codebuild Project.
206+
*/
207+
const codeBuildActionsEnv = new EmbeddedLinuxCodebuildProjectStack(app, "EmbeddedLinuxCodeBuildProject", {
208+
...defaultProps,
209+
imageRepo: buildImageRepo.repository,
210+
imageTag: ImageKind.Ubuntu22_04,
211+
vpc: vpc.vpc,
212+
projectKind: ProjectKind.CodeBuild,
213+
});
214+
codeBuildActionsEnv.addDependency(buildImagePipeline)

0 commit comments

Comments
 (0)