2020-12-18 17:57:52 +00:00
|
|
|
import pkg from 'chai'
|
2020-12-20 16:32:17 +00:00
|
|
|
import { UploadCertToAliyun } from '../../src/aliyun/upload-to-aliyun/index.js'
|
2020-12-18 17:57:52 +00:00
|
|
|
import { Certd } from '@certd/certd'
|
2021-01-01 18:47:58 +00:00
|
|
|
import { createOptions } from '../../../../test/options.js'
|
2020-12-18 17:57:52 +00:00
|
|
|
const { expect } = pkg
|
|
|
|
describe('PluginUploadToAliyun', function () {
|
|
|
|
it('#execute', async function () {
|
2021-01-01 18:47:58 +00:00
|
|
|
this.timeout(5000)
|
|
|
|
const options = createOptions()
|
|
|
|
options.cert.email = 'xiaojunnuo@qq.com'
|
|
|
|
options.cert.domains = ['_.docmirror.cn']
|
2020-12-20 16:32:17 +00:00
|
|
|
const plugin = new UploadCertToAliyun()
|
2021-01-01 18:47:58 +00:00
|
|
|
const certd = new Certd(options)
|
|
|
|
const cert = await certd.readCurrentCert()
|
2020-12-18 17:57:52 +00:00
|
|
|
const context = {}
|
2021-01-01 18:47:58 +00:00
|
|
|
const deployOpts = {
|
2020-12-18 17:57:52 +00:00
|
|
|
accessProviders: options.accessProviders,
|
|
|
|
cert,
|
2021-01-01 18:47:58 +00:00
|
|
|
props: { accessProvider: 'aliyun' },
|
2020-12-25 17:37:53 +00:00
|
|
|
context
|
2021-01-01 18:47:58 +00:00
|
|
|
}
|
|
|
|
await plugin.doExecute(deployOpts)
|
2020-12-18 17:57:52 +00:00
|
|
|
console.log('context:', context)
|
2021-01-01 18:47:58 +00:00
|
|
|
|
|
|
|
// await plugin.sleep(1000)
|
|
|
|
// await plugin.rollback(deployOpts)
|
2020-12-18 17:57:52 +00:00
|
|
|
})
|
|
|
|
})
|