Run batch scripts on a remote server (windows) from jenkins

后端 未结 3 2034
自闭症患者
自闭症患者 2020-12-13 09:58

I\'ve got a continuous integration server (Jenkins ) which builds my code (checks for compilation errors) and runs tests and then deploys the files to a remote server (not a

3条回答
  •  攒了一身酷
    2020-12-13 10:47

    Following Slav's answer above, here is a simpler solution for Jenkins (*nix) to remote (windows):

    1. Install an SSH server on your remote windows (MobaSSH home edition worked well for me)
    2. Make sure your Jenkins user, on your Jenkins machine, has the required certification to open an SSH connection with your remote (you can simply open a terminal and ssh to your remote once, then accept the certification. Make sure it is saved for the Jenkins user).
    3. You can now add an execute shell build phase in your Jenkins job which can SSH to your remote windows machine.

    Notes :

    1. The established connection might require some additional work - you might have to set windows environment variables or map network drivers in order for your executed commands or batch files to work properly on your windows machines.
    2. If you wish to run GUI related operations this solution might not be relevant (Following my work on running automation tests which require GUI manipulation).
    3. Using Jenkins SSH plugin is an issue, as seen here.

提交回复
热议问题