@@ -374,6 +374,30 @@ export class CdkToolkit {
374374 return diffs && options . fail ? 1 : 0 ;
375375 }
376376
377+ public async publish ( options : PublishOptions ) {
378+ const buildAsset = async ( assetNode : AssetBuildNode ) => {
379+ await this . props . deployments . buildSingleAsset (
380+ assetNode . assetManifestArtifact ,
381+ assetNode . assetManifest ,
382+ assetNode . asset ,
383+ {
384+ stack : assetNode . parentStack ,
385+ roleArn : options . roleArn ,
386+ stackName : assetNode . parentStack . stackName ,
387+ } ,
388+ ) ;
389+ } ;
390+
391+ const publishAsset = async ( assetNode : AssetPublishNode ) => {
392+ await this . props . deployments . publishSingleAsset ( assetNode . assetManifest , assetNode . asset , {
393+ stack : assetNode . parentStack ,
394+ roleArn : options . roleArn ,
395+ stackName : assetNode . parentStack . stackName ,
396+ forcePublish : options . force ,
397+ } ) ;
398+ } ;
399+ }
400+
377401 public async deploy ( options : DeployOptions ) {
378402 if ( options . watch ) {
379403 return this . watch ( options ) ;
@@ -1679,6 +1703,19 @@ interface WatchOptions extends Omit<CfnDeployOptions, 'execute'> {
16791703 readonly concurrency ?: number ;
16801704}
16811705
1706+ export interface PublishOptions {
1707+ /**
1708+ * Role to pass to CloudFormation for asset publishing
1709+ */
1710+ roleArn ?: string ;
1711+
1712+ /**
1713+ * Always publish, even if it already exists
1714+ * @default false
1715+ */
1716+ force ?: boolean ;
1717+ }
1718+
16821719export interface DeployOptions extends CfnDeployOptions , WatchOptions {
16831720 /**
16841721 * ARNs of SNS topics that CloudFormation will notify with stack related events
0 commit comments