feat(cli): add publish command for asset publishing#1020
feat(cli): add publish command for asset publishing#1020
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1020 +/- ##
==========================================
+ Coverage 87.76% 87.84% +0.07%
==========================================
Files 72 72
Lines 10137 10214 +77
Branches 1339 1344 +5
==========================================
+ Hits 8897 8972 +75
- Misses 1215 1217 +2
Partials 25 25
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:
|
|
Tried to change it. Could you please take a look at it? |
| }, | ||
| }, | ||
| }, | ||
| 'publish': { |
There was a problem hiding this comment.
not sure about the name yet
There was a problem hiding this comment.
I see. Do you have any good ideas?
publish, build, release, upload, push, prepare, etc...
| 'force': { type: 'boolean', alias: 'f', desc: 'Always publish assets, even if they are already published', default: false }, | ||
| 'asset-parallelism': { type: 'boolean', desc: 'Whether to build/publish assets in parallel' }, | ||
| 'concurrency': { type: 'number', desc: 'Maximum number of simultaneous asset publishing operations (dependency permitting) to execute.', default: 1, requiresArg: true }, | ||
| }, |
There was a problem hiding this comment.
Isn't this the same setting?
There was a problem hiding this comment.
The deploy command's settings already have that configurations. The asset-parallelism determines "whether to parallelize or not," and concurrency determines the number of parallel processes.
However, they certainly look similar. I removed asset-parallelism.
| const buildAsset = async (assetNode: AssetBuildNode) => { | ||
| const buildAssetSpan = await ioHelper.span(SPAN.BUILD_ASSET).begin({ | ||
| asset: assetNode.asset, | ||
| }); | ||
| await deployments.buildSingleAsset( | ||
| assetNode.assetManifestArtifact, | ||
| assetNode.assetManifest, | ||
| assetNode.asset, | ||
| { | ||
| stack: assetNode.parentStack, | ||
| roleArn: options.roleArn, | ||
| stackName: assetNode.parentStack.stackName, | ||
| }, | ||
| ); | ||
| await buildAssetSpan.end(); | ||
| }; | ||
|
|
||
| const publishAsset = async (assetNode: AssetPublishNode) => { | ||
| const publishAssetSpan = await ioHelper.span(SPAN.PUBLISH_ASSET).begin({ | ||
| asset: assetNode.asset, | ||
| }); | ||
| await deployments.publishSingleAsset(assetNode.assetManifest, assetNode.asset, { | ||
| stack: assetNode.parentStack, | ||
| roleArn: options.roleArn, | ||
| stackName: assetNode.parentStack.stackName, | ||
| forcePublish: options.force, | ||
| }); | ||
| await publishAssetSpan.end(); | ||
| }; |
There was a problem hiding this comment.
Lot's of duplication with _deploy() here. Let's find a way to reuse the same code.
There was a problem hiding this comment.
Created createBuildAssetFunction and createPublishAssetFunction.
|
I've updated them based on your feedback. |
Fixes #982
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license