美文网首页
shell自动化部署

shell自动化部署

作者: 乘以零 | 来源:发表于2019-11-29 11:18 被阅读0次

    最近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   
    
    

    相关文章

      网友评论

          本文标题:shell自动化部署

          本文链接:https://www.haomeiwen.com/subject/wliwwctx.html