diff --git a/demos-pipeline/example/bin/poky-pipeline.ts b/demos-pipeline/example/bin/poky-pipeline.ts index 6066c7d..75760b3 100644 --- a/demos-pipeline/example/bin/poky-pipeline.ts +++ b/demos-pipeline/example/bin/poky-pipeline.ts @@ -2,19 +2,17 @@ import * as cdk from "aws-cdk-lib"; import { DemoPipelineStack, - RepoKind, BuildImageDataStack, BuildImagePipelineStack, BuildImageRepoStack, PipelineNetworkStack, ImageKind, + DistributionKind, } from "aws4embeddedlinux-cdk-lib"; const app = new cdk.App(); -/** - * User Data - */ +/* See https://docs.aws.amazon.com/sdkref/latest/guide/access.html for details on how to access AWS. */ const env = { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION, @@ -26,7 +24,7 @@ const env = { */ const defaultProps: cdk.StackProps = { tags: { PURPOSE: "META-AWS-BUILD" }, - terminationProtection: false, // TODO: enable. + terminationProtection: false, // TODO: enable or remove. env, }; @@ -57,7 +55,7 @@ const vpc = new PipelineNetworkStack(app, "PipelineNetwork", { }); /** - * Create a poky pipeline. + * Create a poky distribution pipeline. */ new DemoPipelineStack(app, "PokyPipeline", { ...defaultProps, @@ -74,12 +72,12 @@ new DemoPipelineStack(app, "QemuDemoPipeline", { imageRepo: buildImageRepo.repository, imageTag: ImageKind.Ubuntu22_04, vpc: vpc.vpc, - layerKind: RepoKind.MetaAwsDemo, layerRepoName: "qemu-demo-layer-repo", + distroKind: DistributionKind.MetaAwsDemo, }); /** - * Create a poky pipeline. + * Create a 3rd Party Distribution Pipeline. */ // TODO(nateglims): implement // new DemoPipelineStack(app, "three-p-Pipeline", { diff --git a/demos-pipeline/lib/lib/constructs/source-repo.ts b/demos-pipeline/lib/lib/constructs/source-repo.ts index b66253a..73e17e6 100644 --- a/demos-pipeline/lib/lib/constructs/source-repo.ts +++ b/demos-pipeline/lib/lib/constructs/source-repo.ts @@ -4,15 +4,21 @@ import { Code, Repository } from "aws-cdk-lib/aws-codecommit"; import * as path from "path"; -export enum RepoKind { - /** A Poky Based Repository */ +/** + * The kind of Yocto Distribution built. + */ +export enum DistributionKind { + /** A Poky Based Distribution. */ Poky = "poky", + /** The meta-aws Demonstration Distribution. */ MetaAwsDemo = "meta-aws-demo", } export interface SourceRepoProps extends cdk.StackProps { - readonly repoName: string; - readonly kind: RepoKind; + /** The name of the CodeCommit Repository created. */ + readonly repoName: string; + /** The type of distribution to see this repository with. */ + readonly kind: DistributionKind; } /** diff --git a/demos-pipeline/lib/lib/demo-pipeline.ts b/demos-pipeline/lib/lib/demo-pipeline.ts index 868179a..7f3c235 100644 --- a/demos-pipeline/lib/lib/demo-pipeline.ts +++ b/demos-pipeline/lib/lib/demo-pipeline.ts @@ -19,7 +19,7 @@ import { SecurityGroup, } from "aws-cdk-lib/aws-ec2"; import { Bucket } from "aws-cdk-lib/aws-s3"; -import { SourceRepo, RepoKind } from "./constructs/source-repo"; +import { SourceRepo, DistributionKind } from "./constructs/source-repo"; /** * Properties to allow customizing the build. @@ -32,7 +32,7 @@ export interface DemoPipelineProps extends cdk.StackProps { /** VPC where the networking setup resides. */ readonly vpc: IVpc; /** The type of Layer */ - readonly layerKind?: RepoKind; + readonly distroKind?: DistributionKind; /** A name for the layer-repo that is created. Default is 'layer-repo' */ readonly layerRepoName?: string; } @@ -60,14 +60,14 @@ export class DemoPipelineStack extends cdk.Stack { const dlFS = this.addFileSystem("Downloads", props.vpc, projectSg); const tmpFS = this.addFileSystem("Temp", props.vpc, projectSg); - const sourceRepo = new SourceRepo(this, "SourceRepo", { + /** Create our CodePipeline Actions. */ + + const sourceRepo = new SourceRepo(this, "SourceRepo", { ...props, repoName: props.layerRepoName ?? `layer-repo-${this.stackName}`, - kind: props.layerKind ?? RepoKind.Poky, + kind: props.distroKind ?? DistributionKind.Poky, }); - /** Create our CodePipeline Actions. */ - const sourceOutput = new codepipeline.Artifact(); const sourceAction = new codepipeline_actions.CodeCommitSourceAction({ output: sourceOutput,