mirror of
https://github.com/certd/certd.git
synced 2026-04-14 12:30:54 +08:00
feat: plugin-huawei
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
import { expect } from "chai";
|
||||
import "mocha";
|
||||
import { EchoPlugin } from "../src/plugin";
|
||||
describe("task_plugin", function () {
|
||||
it("#taskplugin", function () {
|
||||
const echoPlugin = new EchoPlugin();
|
||||
const define = echoPlugin.define;
|
||||
echoPlugin.execute({ context: {}, props: { test: 111 } });
|
||||
expect(define.name).eq("EchoPlugin");
|
||||
});
|
||||
});
|
||||
@@ -1,8 +1,8 @@
|
||||
import { IAccessService } from "../../src/access/access-service";
|
||||
import { AbstractAccess, AliyunAccess } from "../../src";
|
||||
import { IAccessService } from "@certd/pipeline";
|
||||
import { AliyunAccess } from "@certd/plugin-aliyun";
|
||||
import { aliyunSecret } from "../user.secret";
|
||||
export class AccessServiceTest implements IAccessService {
|
||||
async getById(id: any): Promise<AbstractAccess> {
|
||||
async getById(id: any): Promise<any> {
|
||||
return {
|
||||
...aliyunSecret,
|
||||
} as AliyunAccess;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { ContextFactory } from "../../src/core/context";
|
||||
import { FileStorage } from "../../src/core/storage";
|
||||
import { ContextFactory, FileStorage, logger } from "@certd/pipeline";
|
||||
import { AccessServiceTest } from "./access-service-test";
|
||||
import { logger } from "../../src/utils/util.log";
|
||||
|
||||
const contextFactory = new ContextFactory(new FileStorage());
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ConcurrencyStrategy, NextStrategy, Pipeline, RunStrategy } from "../../src";
|
||||
import { ConcurrencyStrategy, NextStrategy, Pipeline, RunStrategy } from "@certd/pipeline";
|
||||
|
||||
let idIndex = 0;
|
||||
function generateId() {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//import { expect } from "chai";
|
||||
import "mocha";
|
||||
import { Executor, RunHistory } from "../../src";
|
||||
import { Executor, RunHistory, FileStorage } from "@certd/pipeline";
|
||||
import { pipeline } from "./pipeline.define";
|
||||
import { AccessServiceTest } from "./access-service-test";
|
||||
import { FileStorage } from "../../src/core/storage";
|
||||
import * as all from "../../src";
|
||||
describe("pipeline", function () {
|
||||
it("#pipeline", async function () {
|
||||
this.timeout(120000);
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import { expect } from "chai";
|
||||
import "mocha";
|
||||
import { CertApplyPlugin } from "../../../src/plugin";
|
||||
import { pluginInitProps } from "../init.test";
|
||||
describe("CertApply", function () {
|
||||
it("#execute", async function () {
|
||||
this.timeout(120000);
|
||||
const plugin = new CertApplyPlugin();
|
||||
// @ts-ignore
|
||||
delete plugin.define;
|
||||
await plugin.doInit(pluginInitProps);
|
||||
const output = await plugin.execute({
|
||||
domains: ["*.docmirror.cn", "docmirror.cn"],
|
||||
email: "xiaojunnuo@qq.com",
|
||||
dnsProviderType: "aliyun",
|
||||
accessId: "111",
|
||||
forceUpdate: true,
|
||||
});
|
||||
const cert = output.cert;
|
||||
expect(plugin.getDefine().name).eq("CertApply");
|
||||
expect(cert.crt != null).eq(true);
|
||||
});
|
||||
});
|
||||
@@ -1,23 +0,0 @@
|
||||
import { expect } from "chai";
|
||||
import "mocha";
|
||||
import { DeployCertToAliyunCDN } from "../../../src/plugin";
|
||||
import { pluginInitProps } from "../init.test";
|
||||
|
||||
describe("DeployToAliyunCDN", function () {
|
||||
it("#execute", async function () {
|
||||
this.timeout(120000);
|
||||
const plugin = new DeployCertToAliyunCDN();
|
||||
// @ts-ignore
|
||||
delete plugin.define;
|
||||
|
||||
await plugin.doInit(pluginInitProps);
|
||||
|
||||
const cert = await pluginInitProps.pipelineContext.get("cert");
|
||||
|
||||
await plugin.execute({
|
||||
cert,
|
||||
domainName: "certd-cdn-upload.docmirror.cn",
|
||||
});
|
||||
expect(plugin.getDefine().name).eq("DeployCertToAliyunCDN");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user