# DeployTool **Repository Path**: hbarmy/deploy-tool ## Basic Information - **Project Name**: DeployTool - **Description**: 远程项目部署 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-02-16 - **Last Updated**: 2026-02-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #### 使用说明 - rt 部署当前所在目录项目 - 子命令 ```text 工具配置文件目录: win: C:\Users\Alice mac: /Users/Alice linux: /home/alice rt init [-c FILE] 初始化配置文件,文件名称 deploy.toml -c 指定配置文件路径 rt server 服务器管理 - 新增服务器 list 查询所有服务器信息 -u[--update] [label] 修改服务器 -d[--delete] [label] 删除服务器 -s[--show] [label] 显示服务器信息 rt scp [file...] 上传:scp file ... [服务器标签]:[服务器路径] 下载:scp [服务器标签]:[服务器路径] ... file [本地路径] rt ssh [server] 登录服务器 暂不支持 window rt eidt [action] [file] 修改文件内容 action: '/old/new/' '1 /old/new/' '1,3 /old/new/' '/old\/str/new' old or new 中有/时需要使用转义字符。file 可以是具体的文件路径也可以是文件名、文件名时需要带上 dir 参数指定搜索目录, dir 文件搜索目录如果指定了文件具体路径可省略 ``` - 配置文件参数说明 > command 可以使用变量{deployPath}, {targetName}, {targetPath}替换对应数据。deployPath只在[remote.command]中有效 > > 部署文件名称 > targetName = "test" > > 部署文件目录,默认当前文件夹 > targetPath = "" > > 配置不同环境设置 server name对应服务器管理中的label deploy_path 为远程部署路径 > [[profile.dev.server]] > name = "test" > deployPath= "" > > 环境变量 默认添加profile变量deploy.active 环境变量使用格式 deploy.test > [profile.dev.env] > test = 1 > > [local] > 本地执行命令 > command = [""] > > [remote] > 远程执行命令 > command = ["cd {deployPath} && python3 {targetName}"] > 是否对远程文件进行备份 > backup = false > 备份文件路径 > backupFilePath = "" > > 设置可执行文件的环境变量 > [execution] > JAVA_HOME = "" > > 部署完成后执行的命令,用于清理编译文件等。 > [after] > command = ["echo 'success'"] - 应用配置文件 ```text # 数据文件路径, 主要存储服务器信息 database = "data.db" [envs] # 设置公用环境变量 aaa=bbb [execution] # 设置一些命令行需要的应用可执行路径,会添加到PATH里面 java=xxxxx ```