This commit is contained in:
xiaojunnuo
2025-04-01 22:34:15 +08:00
parent 70760e4ede
commit 071ef281c1
4 changed files with 141 additions and 48 deletions
@@ -0,0 +1,30 @@
name: AliyunAccess
version: 1.0.0
title: 阿里云授权
desc: 阿里云授权
icon: fa-cloud
author:
id:
name:
email:
link:
type: access
input:
accessKeyId:
title: AccessKeyId
type: string
component:
name: a-input
required: true
helper: 访问密钥ID
accessKeySecret:
type: string
title: AccessKeySecret
encrypt: true
script: |
import { AccessInput, BaseAccess, IsAccess } from '@certd/pipeline';
class AliyunAccess extends BaseAccess {
accessKeyId = '';
secretAccessKey = '';
}
@@ -0,0 +1,50 @@
name: AliyunDeployToCdn
version: 1.0.0
author:
title: 阿里云-部署到CDN
desc: 部署证书到阿里云CDN
icon: fa-cloud
pluginType: plugin
metadata:
dependencies:
- "@alicloud/pop-core": "^1.7.10"
input:
endpoint:
type: string,
title: '证书服务接入点',
helper: '不会选就按默认',
value: 'cas.aliyuncs.com',
component:
name: 'a-select',
options:
- value: 'cas.aliyuncs.com'
label: '中国大陆'
required: true,
cert:
type: string,
title: '域名证书',
helper: '请选择前置任务输出的域名证书',
component:
name: 'output-selector',
from:
- 'group:cert_apply',
- 'xxx',
required: true,
script: |
import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput } from '@certd/pipeline';
class AliyunDeployToCdn extends AbstractTaskPlugin {
endpoint = '';
cert = '';
async onInstance() {}
async execute(): Promise<void> {
this.logger.info('开始部署证书到阿里云cdn');
const access = await this.accessService.getById<AliyunAccess>(this.accessId);
const sslClient = new AliyunSslClient({
access,
logger: this.logger,
endpoint: this.endpoint || 'cas.aliyuncs.com',
});
}
}