pull/78/head
xiaojunnuo 2024-06-19 00:53:53 +08:00
parent 5c2c50839a
commit 3c721901c5
1 changed files with 19 additions and 12 deletions

View File

@ -1,9 +1,16 @@
import { AbstractTaskPlugin, IAccessService, ILogger, IsTaskPlugin, RunStrategy, TaskInput } from "@certd/pipeline"; import {
import { SshClient } from "../../lib/ssh"; AbstractTaskPlugin,
IAccessService,
ILogger,
IsTaskPlugin,
RunStrategy,
TaskInput,
} from '@certd/pipeline';
import { SshClient } from '../../lib/ssh';
@IsTaskPlugin({ @IsTaskPlugin({
name: "hostShellExecute", name: 'hostShellExecute',
title: "执行远程主机脚本命令", title: '执行远程主机脚本命令',
input: {}, input: {},
default: { default: {
strategy: { strategy: {
@ -14,20 +21,20 @@ import { SshClient } from "../../lib/ssh";
}) })
export class HostShellExecutePlugin extends AbstractTaskPlugin { export class HostShellExecutePlugin extends AbstractTaskPlugin {
@TaskInput({ @TaskInput({
title: "主机登录配置", title: '主机登录配置',
helper: "登录", helper: '登录',
component: { component: {
name: "pi-access-selector", name: 'pi-access-selector',
type: "ssh", type: 'ssh',
}, },
required: true, required: true,
}) })
accessId!: string; accessId!: string;
@TaskInput({ @TaskInput({
title: "shell脚本命令", title: 'shell脚本命令',
component: { component: {
name: "a-textarea", name: 'a-textarea',
vModel: "value", vModel: 'value',
}, },
}) })
script!: string; script!: string;
@ -46,7 +53,7 @@ export class HostShellExecutePlugin extends AbstractTaskPlugin {
connectConf, connectConf,
script, script,
}); });
this.logger.info("exec res:", ret); this.logger.info('exec res:', ret);
} }
} }