补充一下,如果有项目需要频繁上传文件并运行来测试的话,这种就要比shell方便很多,
shell适合做流水型命令,这个就比较适合做循环的了
此工具用于向远端服务器发送下载文件和shell命令操作,只需配置yaml文件即可
yaml文件:
[AppleScript] 纯文本查看 复制代码 server:
ip: xx.xxx.xxx.xxx
port: 22
account: root
password: xxxxxx
commands:
- ls
- ps
uploads:
-
src: ./ksctl.yaml
dst: /root/ksctl.yaml
-
src: ./xxxx
dst: /root/xxxx
downloads:
-
src: /root/ksctl.yaml
dst: ./ksctl.yaml
-
src: ./xxxx
dst: /root/xxxx
exec:
name: /xxx/xxx
exit: true SyntaxHighlighter Copyright 2004-2013 Alex Gorbatchev.
server为服务器配置 commands命令将会依次运行,每次条指令运行后将返回结果再运行下一条命令 uploads和downloads为上传和下载文件 exec为想要运行的应用程序,name是绝对路径,exit代表当前程序退出时,远程程序是否退出
使用:
[AppleScript] 纯文本查看 复制代码 git clone [url=https://github.com/hxoreyer/ksctl]https://github.com/hxoreyer/ksctl[/url]
go run ksctl.go -f [yaml文件地址(默认为./ksctl.yaml)] SyntaxHighlighter Copyright 2004-2013 Alex Gorbatchev.
Release:
[AppleScript] 纯文本查看 复制代码 ksctl -f [yaml文件地址(默认为./ksctl.yaml)] SyntaxHighlighter Copyright 2004-2013 Alex Gorbatchev.
可将二进制程序放入环境变量path中
项目地址:https://github.com/hxoreyer/ksctl |