从詹金斯远程服务器(Windows)上运行批处理脚本 [英] Run batch scripts on a remote server (windows) from jenkins
问题描述
我有它建立我的code(检查编译错误)并运行测试,然后将文件部署到远程服务器(不是战争文件持续集成服务器(詹金斯),但实际的文件结构)我这样做了詹金斯插件,它可以让我通过Samba文件传输,它这样做晚间。
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 war file, but the actual file structure) I do this with a Jenkins plugin which allows me to transfer files via samba, it does this nightly.
现在,我需要做的是运行在远程服务器上的蚂蚁命令。之后,我需要启动远程服务器上的应用服务器,应用服务器通过在命令行中运行.bat文件启动。
Now, what I need to do is run an ant command on the remote server. And after that I need to start the application server on the remote server, the application server is started by running a .bat file from the command line.
我是pretty无能如何做到这一点,我知道詹金斯能够运行批处理命令的,但如何让他们在服务器的上下文和构建服务器的不是上下文中运行?
I'm pretty clueless how to accomplish this, I know Jenkins is capable of running batch commands, but how do I make them run in the context of the server and not the context of the build server?
推荐答案
我最终尝试psexec.exe了一会儿后,用不同的方法去。
I ended up going with a different approach after trying out psexec.exe for a while.
Psexec.exe和复制文件在网络上有点慢且不稳定,尤其是因为我的工作领域有修改密码每个月(这打破了构建)的政策。
Psexec.exe and copying files over the network was a bit slow and unstable, especially since the domain I work on has a policy of changing password every months (which broke the build).
在我的主/从方法,这是更快,更稳定,去年底。因为我没有使用psexec.exe并没有在网络上复制文件。
In the end I went with the master/slave approach, which is faster and more stable. Since I don't have to use psexec.exe and don't have to copy files over the network.
这篇关于从詹金斯远程服务器(Windows)上运行批处理脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!