feat(cli): add publish-assets command for asset publishing without deployment#1020
Merged
feat(cli): add publish-assets command for asset publishing without deployment#1020
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1020 +/- ##
==========================================
+ Coverage 88.17% 88.19% +0.01%
==========================================
Files 73 73
Lines 10345 10386 +41
Branches 1403 1410 +7
==========================================
+ Hits 9122 9160 +38
- Misses 1196 1199 +3
Partials 27 27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Contributor
Author
|
@mrgrain Applied your comments! |
mrgrain
approved these changes
Apr 1, 2026
|
Thanks you very much to both of you. I really appreciate the effort that you put into this feature. I will definitely try it out immediately after release and change my pipelines. Aghain, thanks a lot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cdk publish-assetsPublishes assets for the specified stack(s) without performing a deployment.
Important
cdk publish-assetsis under development and therefore must be opted in via the--unstableflag:cdk publish-assets --unstable=publish-assets.--unstableindicates that the scope and API of feature might still change. Otherwise the feature is generally production ready and fully supported.Publishes assets (such as Docker images and file assets) for the specified stack(s) to their respective destinations (ECR repositories, S3 buckets) without performing a deployment.
This is useful in CI/CD pipelines where you want to separate the asset build/publish phase from the deployment phase.
Currently,
cdk deploycombines asset publishing and stack deployment into a single operation. This makes it difficult to structure CI/CD pipelines where assets should be built and published once, then reused across multiple deployment stages (e.g. dev → staging → production). The solution today is to use the standalonecdk-assetsCLI directly, which requires an additional dependency and likely not easily discoverable.This PR adds
cdk publish-assetsas a first-class CLI command, making the same functionality available without extra dependencies and with the familiar CDK CLI experience (stack selectors,--exclusively,--all,--concurrency).On the implementation side, the inline
buildAssetandpublishAssetfunctions in the deploy path have been extracted into reusablecreateBuildAssetFunctionandcreatePublishAssetFunctionmethods on theToolkitclass, so bothdeployandpublish-assetsshare the same asset handling logic.Fixes #982
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license