在整个开发流程中,gitlab-runner-ci是搭建在linux下。web自动化是在windows下面进行的。

如果ci构建完版本、部署完后,需要触发启动自动化执行。

那么我们需要在部署完后在linux下再调用win下自动化启动脚本。这样就做到提交代码后,编译、单元测试、覆盖率、打包、系统测试无人干预的全自动化处理。

1、启用win下telnet服务。(开启方法略)

2、使用ruby net-telnet包实现如下:  

require 'net/telnet'
localhost = '172.17.x.xx'
userName = 'shenxxxxxx'
passWD = 'shenxxxxxx'

host = Net::Telnet::new(
         "Host"       => localhost,
         "Prompt"=> /C:.*>/)

host.login(userName, passWD) { |c| print c }
host.cmd("dir") { |c| print c }
host.close

 

执行结果如下:

ruby linux连接windows执行dos命令

相关文章:

  • 2022-12-23
  • 2021-10-01
  • 2021-12-06
  • 2022-01-15
  • 2022-12-23
  • 2021-11-21
  • 2021-10-23
猜你喜欢
  • 2021-05-29
  • 2021-07-16
  • 2022-01-05
  • 2022-02-07
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案