- 최신
- 최다 투표
- 가장 많은 댓글
It is supported and the name you're looking for is correct. So I think you just have a small error.
Here's an example (CDK Typescript): https://github.com/awslabs/aws-greengrass-labs-component-for-the-things-stack-lorawan/blob/main/cicd/lib/cicd-stack.ts
The output from the build stage is passed as an extra input to the deploy stage. Both of which are CodeBuild actions:
const buildAction = new codepipeline_actions.CodeBuildAction({
actionName: `${Names.PREFIX_DASH}-build`,
project: buildProject,
input: source,
outputs: [build]
});
const deployAction = new codepipeline_actions.CodeBuildAction({
actionName: `${Names.PREFIX_DASH}-deploy`,
project: deployProject,
input: source,
extraInputs: [build],
outputs: [deploy],
environmentVariables: {
"GREENGRASS_CORE_NAME": { value: context.greengrassCoreName }
}
});
And the buildspec for the deploy stage, that consumes the output from the build stage: https://github.com/awslabs/aws-greengrass-labs-component-for-the-things-stack-lorawan/blob/main/cicd/deployspec.yaml
# Get the recipe file generated by the build stage
- RECIPE_FILE=$(ls $CODEBUILD_SRC_DIR_Build/aws.greengrass.labs.*.json)
How about caching in AWS CodeBuild. A cache can store reusable pieces of your build environment and use them across multiple builds. Your build project can use one of two types of caching: Amazon S3 or local.
CodeBuild also supports secondaryArtifacts. These artifacts use the secondary-artifacts block of the buildspec file that is nested inside the artifacts block.
Hey RoB - thanks, I looked into caching and that appears to be an optimization for a single codebuild step - i need a normal workflow with separate producing and consuming steps. As for secondary artifacts, I'm using that feature - it just doesn't behave the way I would expect.
관련 콘텐츠
- AWS 공식업데이트됨 일 년 전
Hey Greg - many apologies for not touching base back sooner. I saw your answer but was getting some weirdness in the portal. My scenario is specific to using CodeBuild within CodePipeline. There are some constraints with this that are not applicable with CodeBuild so I dont think this example will work for me.
Dave, the example above is indeed CodeBuild within CodePipeline.