feat: 腾讯云cdn支持

This commit is contained in:
xiaojunnuo
2020-12-26 01:37:53 +08:00
parent ec81572670
commit 25dae3d1ec
31 changed files with 10185 additions and 121 deletions
+35 -4
View File
@@ -9,13 +9,44 @@ export class AbstractPlugin {
const { contextPath } = options
const contextJson = fs.readFileSync(contextPath)
const context = JSON.parse(contextJson)
const newContext = await this.execute(options, context)
options.context = context
const newContext = await this.execute(options)
fs.writeFileSync(JSON.stringify(newContext || context))
}
async execute (options, context) {
console.log('请实现此方法,context:', context)
return context
async doExecute (options) {
try {
return await this.execute(options)
} catch (e) {
logger.error('插件执行出错:', e)
throw e
}
}
/**
* 执行
* @param options
* @returns {Promise<void>}
*/
async execute (options) {
console.error('请实现此方法,context:', options.context)
}
async doRollback (options) {
try {
return await this.rollback(options)
} catch (e) {
logger.error('插件rollback出错:', e)
throw e
}
}
/**
* 回退,如有必要
* @param options
*/
async rollback (options) {
console.error('请实现此方法,rollback:', options.context)
}
getAccessProvider (accessProvider, accessProviders) {