Skip to content

Commit

Permalink
fix: change staticCdn to staticConf
Browse files Browse the repository at this point in the history
  • Loading branch information
yugasun committed Jul 9, 2020
1 parent c9c0ced commit e481a94
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ inputs:
secretName: secret
secretIds:
- xxx
staticCdn:
staticConf:
cosConf:
bucket: static-bucket
acl:
Expand Down Expand Up @@ -109,7 +109,7 @@ inputs:
| [apigatewayConf](#API-网关配置) | 否 | | API 网关配置 |
| [cloudDNSConf](#DNS-配置) | 否 | | DNS 配置 |
| [Region special config](#指定区配置) | 否 | | 指定区配置 |
| [staticCdn](#静态资源-CDN-配置) | 否 | | 静态资源 CDN 配置 |
| [staticConf](#静态资源-CDN-配置) | 否 | | 静态资源 CDN 配置 |

## 执行目录

Expand Down
20 changes: 10 additions & 10 deletions src/serverless.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,11 @@ class ServerlessComopnent extends Component {
}

// start deploy static cdn
if (inputs.staticCdn) {
const staticDeployRes = await this.deployStatic(credentials, inputs.staticCdn, regionList[0])
if (inputs.staticConf) {
const staticDeployRes = await this.deployStatic(credentials, inputs.staticConf, regionList[0])
if (staticDeployRes) {
this.state.staticCdn = staticDeployRes
outputs.staticCdn = staticDeployRes
this.state.staticConf = staticDeployRes
outputs.staticConf = staticDeployRes
}
}

Expand All @@ -286,19 +286,19 @@ class ServerlessComopnent extends Component {

async removeStatic() {
// remove static
const { region, staticCdn } = this.state
if (staticCdn) {
const { region, staticConf } = this.state
if (staticConf) {
const credentials = this.getCredentials()
// 1. remove cos
if (staticCdn.cos) {
if (staticConf.cos) {
const cos = new Cos(credentials, region)
await cos.remove(staticCdn.cos)
await cos.remove(staticConf.cos)
}
// 2. remove cdn
if (staticCdn.cdn) {
if (staticConf.cdn) {
const cdn = new Cdn(credentials)
try {
await cdn.remove(staticCdn.cdn)
await cdn.remove(staticConf.cdn)
} catch (e) {
// no op
}
Expand Down

0 comments on commit e481a94

Please sign in to comment.