Skip to content

Commit 8d6d573

Browse files
committed
feat: add ignoreUpdate options for apigw, cdn, cos
1 parent d489158 commit 8d6d573

File tree

7 files changed

+22
-5
lines changed

7 files changed

+22
-5
lines changed

src/modules/apigw/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ export default class Apigw {
8080
}
8181

8282
/** 部署 API 网关 */
83-
async deploy(inputs: ApigwDeployInputs) {
83+
async deploy(inputs: ApigwDeployInputs): Promise<ApigwDeployOutputs | undefined> {
84+
if (inputs.ignoreUpdate) {
85+
console.log('API Gateway update ignored');
86+
return;
87+
}
8488
const {
8589
environment = 'release' as const,
8690
oldState = {},

src/modules/apigw/interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ export interface ApiDeployInputs {
181181
}
182182

183183
export interface ApigwDeployInputs extends ApigwCreateServiceInputs, ApigwBindCustomDomainInputs {
184+
ignoreUpdate?: boolean;
184185
region?: RegionType;
185186
oldState?: any;
186187
environment?: EnviromentType;

src/modules/cdn/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ export default class Cdn {
6565
}
6666

6767
/** 部署 CDN */
68-
async deploy(inputs: CdnDeployInputs) {
68+
async deploy(inputs: CdnDeployInputs): Promise<CdnOutputs | undefined> {
69+
if (inputs.ignoreUpdate) {
70+
console.log('CDN update ignored');
71+
return;
72+
}
6973
await openCdnService(this.capi);
7074
const { oldState = {} } = inputs;
7175
delete inputs.oldState;

src/modules/cdn/interface.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export interface CertInfo {
1010
export interface CdnDeployInputs {
1111
oldState?: any;
1212

13+
ignoreUpdate?: boolean;
14+
1315
area: string;
1416

1517
/** 是否等待 CDN 部署完毕 */
@@ -102,8 +104,9 @@ export interface CdnOutputs {
102104
domain: string;
103105
origins: string[];
104106
cname: string;
105-
inputCache: string;
107+
inputCache?: string;
106108
resourceId?: string;
107109

108110
tags?: TagInput[];
111+
refreshUrls?: string[];
109112
}

src/modules/cos/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,11 @@ export default class Cos {
628628
return `${inputs.bucket}.cos-website.${this.region}.myqcloud.com`;
629629
}
630630

631-
async deploy(inputs: CosDeployInputs = {}) {
631+
async deploy(inputs: CosDeployInputs = {}): Promise<CosDeployInputs | undefined> {
632+
if (inputs.ignoreUpdate) {
633+
console.log('COS update ignored');
634+
return;
635+
}
632636
await this.createBucket(inputs);
633637
if (inputs.acl) {
634638
await this.setAcl(inputs);

src/modules/cos/interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ export interface CosDeployInputs
192192
CosSetLifecycleInputs,
193193
CosSetVersioningInputs,
194194
CosWebsiteInputs {
195+
ignoreUpdate?: boolean;
195196
keyPrefix?: string;
196197
rules?: {
197198
status?: string;

src/modules/triggers/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ export class TriggerManager {
384384
netTypes: parameters?.netTypes,
385385
});
386386
outputs.created = true;
387-
outputs.serviceId = res.serviceId;
387+
outputs.serviceId = res?.serviceId;
388388
}
389389
return outputs;
390390
}

0 commit comments

Comments
 (0)