一份清单,一条命令,一批服务器
单文件·无依赖·YAML 驱动·跨平台
单文件、无依赖,将批量操作编写为可复用的流程
将一个或多个操作组合为有序流程。命令执行、上传、下载可自由组合,由单条命令触发执行。
完整流程写入 inventory.yaml,可提交、可审查,便于团队理解发布流程。
内建 command / push / fetch / script 四种 action,可独立使用,亦可组合为流程。
push / fetch 支持目录。默认递归逐文件,加 -z 则打包传输。
AES-256-GCM 加密清单中的密码。密钥由用户管理,不硬编码在二进制中。
通过 serial 与 min_available 控制每批主机数与安全余量,支持滚动部署与回退。
创建密钥、定义清单、执行任务
用于加密清单中的密码。只需创建一次:openssl rand -base64 32 > ~/.taskssh/vault-key
创建 inventory.yaml,声明服务器组、主机及任务步骤。
运行 taskssh release prod -y,按清单定义完成整个流程。
tasks:
release:
steps:
- name: "上传新版本"
action: push
with:
file: "./dist/{{app_name}}-{{version}}.jar"
dest: "{{service_path}}"
force: true
- name: "重启服务"
action: command
with:
command: "systemctl restart {{app_name}}"
delay: 5
- name: "健康检查"
action: command
with:
command: "curl -sf http://localhost:8080/health"
执行:taskssh release prod -i inventory.yaml -y
四种原子 Action,覆盖常规批量运维场景
执行远程命令
taskssh command prod -e "ls -la /opt"
上传文件或目录到远程
taskssh push prod -f app.jar -d /opt/app/
从远程下载文件或目录
taskssh fetch prod -f /var/log/app.log -d ./logs/
上传本地脚本并执行
taskssh script prod -f ./deploy.sh -r