mirror of
https://github.com/certd/certd.git
synced 2026-04-14 20:40:53 +08:00
perf: 小优化
This commit is contained in:
12
packages/executor/package-lock.json
generated
12
packages/executor/package-lock.json
generated
@@ -2873,9 +2873,9 @@
|
||||
"integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew="
|
||||
},
|
||||
"qs": {
|
||||
"version": "6.9.4",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz",
|
||||
"integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ=="
|
||||
"version": "6.9.6",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz",
|
||||
"integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ=="
|
||||
},
|
||||
"randombytes": {
|
||||
"version": "2.1.0",
|
||||
@@ -3444,9 +3444,9 @@
|
||||
}
|
||||
},
|
||||
"tencentcloud-sdk-nodejs": {
|
||||
"version": "4.0.46",
|
||||
"resolved": "https://registry.npmjs.org/tencentcloud-sdk-nodejs/-/tencentcloud-sdk-nodejs-4.0.46.tgz",
|
||||
"integrity": "sha512-EP6K2da9yJsKWQcaMJ2dV2WyuwassBckUeLflGQZITKBz3kF92TkNdE1A1JzO74MAdzA2PhIuvaDXxxYAAaThA==",
|
||||
"version": "4.0.49",
|
||||
"resolved": "https://registry.npmjs.org/tencentcloud-sdk-nodejs/-/tencentcloud-sdk-nodejs-4.0.49.tgz",
|
||||
"integrity": "sha512-4mZIwIup5oTtmlXtyyqGIUdpurLFdU25ZLcgjElcKOep8HYnMKVXNCvV57WXEMJx+UBc+wYg21OBQd6neUSkxg==",
|
||||
"requires": {
|
||||
"babel-eslint": "^10.0.2",
|
||||
"eslint-plugin-react": "^7.17.0",
|
||||
|
||||
@@ -22,7 +22,19 @@ export class Executor {
|
||||
this.trace = new Trace()
|
||||
}
|
||||
|
||||
use (plugin) {
|
||||
useProviders (providers) {
|
||||
if (providers) {
|
||||
_.forEach(item => {
|
||||
Certd.use(item)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
useProvider (provider) {
|
||||
Certd.use(provider)
|
||||
}
|
||||
|
||||
usePlugin (plugin) {
|
||||
if (plugin == null) {
|
||||
return
|
||||
}
|
||||
@@ -38,9 +50,9 @@ export class Executor {
|
||||
|
||||
usePlugins (plugins) {
|
||||
if (plugins) {
|
||||
for (const plugin of plugins) {
|
||||
this.use(plugin)
|
||||
}
|
||||
_.forEach(plugins, item => {
|
||||
this.usePlugin(item)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +70,7 @@ export class Executor {
|
||||
async doRun (options) {
|
||||
// 申请证书
|
||||
logger.info('任务开始')
|
||||
const certd = new Certd(options)
|
||||
const certd = new Certd(options, this.providers)
|
||||
const cert = await this.runCertd(certd)
|
||||
if (cert == null) {
|
||||
throw new Error('申请证书失败')
|
||||
|
||||
@@ -16,7 +16,10 @@ describe('AutoDeploy', function () {
|
||||
this.timeout(120000)
|
||||
const executor = new Executor()
|
||||
const options = createOptions()
|
||||
const ret = await executor.run(options, { forceCert: true, forceDeploy: false })
|
||||
options.args.forceCert = true
|
||||
options.args.forceDeploy = true
|
||||
|
||||
const ret = await executor.run(options)
|
||||
expect(ret).ok
|
||||
expect(ret.cert).ok
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user