mirror of
https://github.com/certd/certd.git
synced 2026-05-15 20:47:31 +08:00
perf: 手动上传证书部署流水线
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { Autoload, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
|
||||
import { CertInfoService } from '../monitor/index.js';
|
||||
import { pipelineEmitter } from '@certd/pipeline';
|
||||
import { CertReader, EVENT_CERT_APPLY_SUCCESS } from '@certd/plugin-cert';
|
||||
import { PipelineEvent } from '@certd/pipeline/dist/service/emit.js';
|
||||
import { Autoload, Init, Inject, Scope, ScopeEnum } from "@midwayjs/core";
|
||||
import { CertInfoService } from "../monitor/index.js";
|
||||
import { pipelineEmitter } from "@certd/pipeline";
|
||||
import { CertInfo, EVENT_CERT_APPLY_SUCCESS } from "@certd/plugin-cert";
|
||||
import { PipelineEvent } from "@certd/pipeline/dist/service/emit.js";
|
||||
|
||||
@Autoload()
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
@@ -15,8 +15,8 @@ export class AutoEPipelineEmitterRegister {
|
||||
await this.onCertApplySuccess();
|
||||
}
|
||||
async onCertApplySuccess() {
|
||||
pipelineEmitter.on(EVENT_CERT_APPLY_SUCCESS, async (event: PipelineEvent<CertReader>) => {
|
||||
await this.certInfoService.updateCertByPipelineId(event.pipeline.id, event.event);
|
||||
pipelineEmitter.on(EVENT_CERT_APPLY_SUCCESS, async (event: PipelineEvent<{cert:CertInfo,file:string}>) => {
|
||||
await this.certInfoService.updateCertByPipelineId(event.pipeline.id, event.event.cert, event.event.file);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user