feat: 脚本或工具对应修改增加命令行扩展

This commit is contained in:
ZhaoLei 2024-10-29 13:13:22 +08:00
parent 4724e96efe
commit 2037f1ac4a
2 changed files with 62 additions and 71 deletions

View file

@ -4,61 +4,6 @@ import WebSocket from "ws";
//#region ############################## 配置文件 ################################### //#region ############################## 配置文件 ###################################
const LocalHost = "127.0.0.1"; const LocalHost = "127.0.0.1";
//这是个例子,请在`config`中写你的配置
const example_config = {
//发布的名称,每个项目具有唯一的一个名称
Name: "FYMF",
RemotePwd: "FYMF",
//远程服务器地址,也就是发布的目的地,它是正式环境
RemoteUrl: "127.0.0.1:8007",
//是否发布数据库 sqlserver
IsDeployDb: false,
//是否发布前重新构建项目
IsDeployProject: true,
//项目地址
LocalProjectAbsolutePath:
"D:/git/HMES-H7-HNFY/HMES-H7-HNFYMF/HMES-H7-HNFYMF.WEB",
//源文件目录地址,是要发布的文件根目录,它是绝对路径,!执行发布时将发布到这个目录!
LocalRootPath: "D:/FileSyncTest/src",
//目标文件目录地址,也就是部署服务的机器上的项目文件根目录,它是绝对路径
RemoteRootPath: "D:/FYMF",
//源数据库配置 SqlServer,将会同步数据库的结构
SrcDb: {
//Host
ServerName: "172.16.12.2",
//数据库名
DatabaseName: "HMES_H7_HNFYMF",
User: "hmes-h7",
Password: "Hmes-h7666",
//是否信任服务器证书
TrustServerCertificate: "True",
//同步的数据,这些数据将会同步
SyncTablesData: [
"dbo.sys_Button",
"dbo.sys_Menu",
"dbo.sys_Module",
"dbo.sys_Page",
],
},
//目标数据库配置 sqlserver
DstDb: {
ServerName: "127.0.0.1",
DatabaseName: "HMES_H7_HNFYMF",
User: "sa",
Password: "Yuanmo520...",
TrustServerCertificate: "True",
},
//子目录配置每个子目录都有自己不同的发布策略它是相对路径即相对于LocalRootPath和RemoteRootPath(注意 '/',这将拼成一个完整的路径),文件数据依此进行,
DirFileConfigs: [
{
DirPath: "/bin",
//排除的文件或目录它是相对路径相对于LocalRootPath和RemoteRootPath
Excludes: ["/roslyn", "/Views"],
//只追踪文件或目录它是相对路径相对于LocalRootPath和RemoteRootPath它的优先级最高如果你指定了它的值Excludes将会失效
// CherryPicks:[]
},
],
};
const config = { const config = {
//发布的名称,每个项目具有唯一的一个名称 //发布的名称,每个项目具有唯一的一个名称
Name: "FYMF", Name: "FYMF",
@ -112,6 +57,21 @@ const config = {
// CherryPicks:[] // CherryPicks:[]
}, },
], ],
ExecProcesses: [],
// ExecProcesses:[
// {
// // 参数
// Argumnets:"ls",
// // 执行命令位置
// FileName:"powershell",
// // 相关步骤开始之前B或之后 (A)
// StepBeforeOrAfter:"A",
// // 本地L或远程 (R) 执行
// ExecInLocalOrServer:"L",
// // 步骤 1. 连接远程 2. 发布项目 3. 文件对比 4. 提取sqlserver 5. 打包上传 6. 发布
// Step:1
// }
// ]
}; };
//#endregion //#endregion
@ -143,9 +103,9 @@ function PrintSuccessInNewLine(str) {
*/ */
function PrintCloseNewLine(str) { function PrintCloseNewLine(str) {
if (IsSuccess) { if (IsSuccess) {
PrintSuccessInNewLine(str) PrintSuccessInNewLine(str);
} else { } else {
PrintErrInNewLine(str) PrintErrInNewLine(str);
} }
} }
/** /**
@ -171,7 +131,7 @@ function MsgCb(MsgIt) {
PrintSuccessInNewLine(`(${MsgIt.Step}/6) ${MsgIt.Body}`); PrintSuccessInNewLine(`(${MsgIt.Step}/6) ${MsgIt.Body}`);
if (MsgIt.Step == 6) { if (MsgIt.Step == 6) {
if (MsgIt.Body == "发布完成!") { if (MsgIt.Body == "发布完成!") {
IsSuccess = true IsSuccess = true;
ws.close(); ws.close();
} }
} }

View file

@ -16,22 +16,33 @@ let Pipe = null
const Msgs = ref([]) const Msgs = ref([])
const code = ref(` const code = ref(`
config = { config = {
Name: "Test", //
RemoteUrl: "127.0.0.1:6819", Name: "FYMF",
RemotePwd: "t123", RemotePwd: "FYMF",
IsDeployDb: false, //
RemoteUrl: "127.0.0.1:8007",
// sqlserver
IsDeployDb: true,
//
IsDeployProject: false, IsDeployProject: false,
//
LocalProjectAbsolutePath: LocalProjectAbsolutePath:
"D:/git/HMES-H7-HNFY/HMES-H7-HNFYMF/HMES-H7-HNFYMF.WEB", "D:/git/HMES-H7-HNFY/HMES-H7-HNFYMF/HMES-H7-HNFYMF.WEB",
//!!
LocalRootPath: "D:/FileSyncTest/src", LocalRootPath: "D:/FileSyncTest/src",
//
RemoteRootPath: "D:/FileSyncTest/dst", RemoteRootPath: "D:/FYMF",
// SqlServer,
SrcDb: { SrcDb: {
//Host
ServerName: "172.16.12.2", ServerName: "172.16.12.2",
//
DatabaseName: "HMES_H7_HNFYMF", DatabaseName: "HMES_H7_HNFYMF",
User: "hmes-h7", User: "hmes-h7",
Password: "Hmes-h7666", Password: "Hmes-h7666",
//
TrustServerCertificate: "True", TrustServerCertificate: "True",
//
SyncTablesData: [ SyncTablesData: [
"dbo.sys_Button", "dbo.sys_Button",
"dbo.sys_Menu", "dbo.sys_Menu",
@ -39,19 +50,39 @@ config = {
"dbo.sys_Page", "dbo.sys_Page",
], ],
}, },
// sqlserver
DstDb: { DstDb: {
ServerName: "127.0.0.1", ServerName: "127.0.0.1",
DatabaseName: "HMES_H7_HNFYMF", DatabaseName: "HMES_H7_HNFYMF",
User: "sa", User: "sa",
Password: "0", Password: "Yuanmo520...",
TrustServerCertificate: "True", TrustServerCertificate: "True",
}, },
//LocalRootPathRemoteRootPath( '/'),
DirFileConfigs: [ DirFileConfigs: [
{ {
DirPath: "/bin", DirPath: "/bin",
//LocalRootPathRemoteRootPath
Excludes: ["/roslyn", "/Views"], Excludes: ["/roslyn", "/Views"],
//LocalRootPathRemoteRootPathExcludes
// CherryPicks:[]
}, },
], ],
ExecProcesses: [],
// ExecProcesses:[
// {
// //
// Argumnets:"ls",
// //
// FileName:"powershell",
// // B (A)
// StepBeforeOrAfter:"A",
// // L (R)
// ExecInLocalOrServer:"L",
// // 1. 2. 3. 4. sqlserver 5. 6.
// Step:1
// }
// ]
}; };
`) `)
var CStatus = ref('None') var CStatus = ref('None')