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,17 +4,16 @@ import WebSocket from "ws";
//#region ############################## 配置文件 ###################################
const LocalHost = "127.0.0.1";
//这是个例子,请在`config`中写你的配置
const example_config = {
const config = {
//发布的名称,每个项目具有唯一的一个名称
Name: "FYMF",
RemotePwd: "FYMF",
//远程服务器地址,也就是发布的目的地,它是正式环境
RemoteUrl: "127.0.0.1:8007",
//是否发布数据库 sqlserver
IsDeployDb: false,
IsDeployDb: true,
//是否发布前重新构建项目
IsDeployProject: true,
IsDeployProject: false,
//项目地址
LocalProjectAbsolutePath:
"D:/git/HMES-H7-HNFY/HMES-H7-HNFYMF/HMES-H7-HNFYMF.WEB",
@ -58,60 +57,21 @@ const example_config = {
// CherryPicks:[]
},
],
};
const config = {
//发布的名称,每个项目具有唯一的一个名称
Name: "FYMF",
RemotePwd: "FYMF",
//远程服务器地址,也就是发布的目的地,它是正式环境
RemoteUrl: "127.0.0.1:8007",
//是否发布数据库 sqlserver
IsDeployDb: true,
//是否发布前重新构建项目
IsDeployProject: false,
//项目地址
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:[]
},
],
ExecProcesses: [],
// ExecProcesses:[
// {
// // 参数
// Argumnets:"ls",
// // 执行命令位置
// FileName:"powershell",
// // 相关步骤开始之前B或之后 (A)
// StepBeforeOrAfter:"A",
// // 本地L或远程 (R) 执行
// ExecInLocalOrServer:"L",
// // 步骤 1. 连接远程 2. 发布项目 3. 文件对比 4. 提取sqlserver 5. 打包上传 6. 发布
// Step:1
// }
// ]
};
//#endregion
@ -142,10 +102,10 @@ function PrintSuccessInNewLine(str) {
* 在新行打印一般信息
*/
function PrintCloseNewLine(str) {
if(IsSuccess) {
PrintSuccessInNewLine(str)
if (IsSuccess) {
PrintSuccessInNewLine(str);
} else {
PrintErrInNewLine(str)
PrintErrInNewLine(str);
}
}
/**
@ -171,14 +131,14 @@ function MsgCb(MsgIt) {
PrintSuccessInNewLine(`(${MsgIt.Step}/6) ${MsgIt.Body}`);
if (MsgIt.Step == 6) {
if (MsgIt.Body == "发布完成!") {
IsSuccess = true
IsSuccess = true;
ws.close();
}
}
} else if(MsgIt == 7) {
} else if (MsgIt == 7) {
PrintErrInNewLine(MsgIt.Body);
} else {
PrintCloseNewLine("(关闭)"+ MsgIt.Body);
PrintCloseNewLine("(关闭)" + MsgIt.Body);
}
}
}

View file

@ -16,22 +16,33 @@ let Pipe = null
const Msgs = ref([])
const code = ref(`
config = {
Name: "Test",
RemoteUrl: "127.0.0.1:6819",
RemotePwd: "t123",
IsDeployDb: false,
//
Name: "FYMF",
RemotePwd: "FYMF",
//
RemoteUrl: "127.0.0.1:8007",
// sqlserver
IsDeployDb: true,
//
IsDeployProject: false,
//
LocalProjectAbsolutePath:
"D:/git/HMES-H7-HNFY/HMES-H7-HNFYMF/HMES-H7-HNFYMF.WEB",
//!!
LocalRootPath: "D:/FileSyncTest/src",
RemoteRootPath: "D:/FileSyncTest/dst",
//
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",
@ -39,19 +50,39 @@ config = {
"dbo.sys_Page",
],
},
// sqlserver
DstDb: {
ServerName: "127.0.0.1",
DatabaseName: "HMES_H7_HNFYMF",
User: "sa",
Password: "0",
Password: "Yuanmo520...",
TrustServerCertificate: "True",
},
//LocalRootPathRemoteRootPath( '/'),
DirFileConfigs: [
{
DirPath: "/bin",
//LocalRootPathRemoteRootPath
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')