-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Pipelines] Running additional actions in the default "Build" stage #9021
Comments
Build
stage
In my case, I have to build several subprojects - a frontend, lambdas (Golang), lambdas (TS), and email templates. The build outputs are referenced from the CDK code, i.e. using This means that the synth action (a CodeBuild project) needs to accept the build outputs of the subprojects builds (parallel CodeBuild projects) and copy them to the location where |
I was able to work around this by having my infrastructure, frontend, and lambda code all in the same package. My build command also builds the frontend + lambdas and then packages them into secondary artifacts that I can upload to S3 and pass along to the application stage. It's not too pretty, and I still don't have a good way of passing the frontend/lambda assets to the application stage without relying on hardcoded bucket names, but it does work for the most part. The one catch I've found so far is that it doesn't trigger changes to |
@tneely I do not completely follow. Instead of using additional outputs and introducing a custom Also, your install/build commands build process your projects in sequential order. My intention was to speed the build phase by executing separate CodeBuild projects in parallel. For pure TypeScript projects, a single CodeBuild project might work well with Lerna/Yarn workspaces, but when you use different languages or different setup it gets complicated. |
I have not thought through this completely. My goal was/is to separate and parallelize builds from the synth action using separate CodeBuild projects. For the synth action to work, we must provide it with the output artifacts from the build projects and copy/move them to the location where This issue will allow the user to implement the required build logic herself, but I wonder if the CDK could/should handle this as well ... in any case, that might better be tackled in a different issue. What do you think @rix0rrr? |
For people with specific requirements: * Allow supplying an existing (preconfigured) CodePipeline object, via the `codePipeline` argument. This pipeline may already have Source and Build stages, in which case `sourceAction` and `synthAction` are no longer required. * Allow access to the underlying CodePipeline object via the `.codePipeline` property, and allow modifying it via `pipeline.stage("Source").addAction(...)`. Fixes #9021.
For people with specific requirements: * Allow supplying an existing (preconfigured) CodePipeline object, via the `codePipeline` argument. This pipeline may already have Source and Build stages, in which case `sourceAction` and `synthAction` are no longer required. * Allow access to the underlying CodePipeline object via the `.codePipeline` property, and allow modifying it via `pipeline.stage("Source").addAction(...)`. Fixes #9021. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Possibility to run additional actions during the default
Build
phase. Apart from the CDK build, other builds such as website builds might be required. A website might be built and deployed along with the CDK app within the same pipeline.Use Case
Running additional build actions in the default
Build
phase such as website builds.Proposed Solution
Making the build stage a public property ofpipelines.CdkPipeline
so that custom actions can be added.Let the user specify an array of
buildActions
instead of a singlesynthAction
, e.g.I think this covers all possible needs. Also, it is consistent with
codepipeline.StageProps.actions
:aws-cdk/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts
Lines 47 to 51 in 403d657
Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: