最近jenkins坏了 每次都要重新打包 ssh测试+正式 运行命令 太复杂了 用expect命令弄了个自动化发布 仅供参考
#!/usr/bin/expect
set timeout 60
spawn scp ywtf-core/target/ywtf-core-1.0.0-SNAPSHOT.jar root@ip:/home/search/ywtf
expect "*password:*" {send "password\r"}
expect eof
spawn ssh root@ip "cd /home/search/ywtf; sh restart.sh"
expect "*password:*" {send "password\r"}
expect eof
网友评论