STAF:如何将STAF启动的进程的输出立即重定向到hudson控制台?
我正在使用 STAF 从批处理文件启动 ruby 命令。
STAF $TESTMACHINE process start command ruby "C:\MyProject\scripts\MasterScript.rb" WAIT SAMECONSOLE RETURNSTDERR RETURNSTDOUT WORKDIR "C:\MyProject\scripts"
此批处理文件由 Hudson 作业触发。但我的观察是,只有在 ruby 脚本 [Hudson job] 执行完成后,ruby 文件的打印/放置才会出现在 hudson 控制台中。这样,除非作业完成,否则我无法确定脚本执行中是否出现问题。
另外,我知道如果删除 RETURNSTDERR RETURNSTDOUT,ruby 脚本的输出将显示在目标计算机上的 STAF 控制台中。所以 STAF 是将 ruby 输出发送回 hudson 控制台的那个。
现在我可以使用 STAF 的任何选项来将 ruby 输出自发地发送到 hudson 控制台吗?
感谢您阅读这个冗长的问题:)
I am starting a ruby command from a batch file using STAF.
STAF $TESTMACHINE process start command ruby "C:\MyProject\scripts\MasterScript.rb" WAIT SAMECONSOLE RETURNSTDERR RETURNSTDOUT WORKDIR "C:\MyProject\scripts"
This batch file is triggered by a Hudson job. But my observation is that the print/puts of the ruby files appear in the hudson console only after the completion of the execution of the ruby script [Hudson job]. This way I can not make out if something is going wrong in the script execution unless the job completes.
Also, I understand that if I remove RETURNSTDERR RETURNSTDOUT, the ruby script's output is displayed in the STAF console on the target machine. So STAF is the one which is sending back the ruby outputs to the hudson console.
Now can I use any option with STAF to get the ruby output spontaneously to the hudson console?
Thanks for reading this lengthy question :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 SSH 而不是 STAF 来完成此类任务。
看来使用 STAF 有点棘手,可以使用 OUTPUT 选项来完成。
如果您有共享存储,例如 hudson 服务器上名为 /nfs 的 NFS 共享和 Windows 上名为 d:\nfs 的 NFS 共享,则以下 hudson 作业应该可以工作:
STAF $TESTMACHINE 进程启动命令 ruby "C:\MyProject\scripts\MasterScript.rb" WAIT SAMECONSOLE RETURNSTDERR RETURNSTDOUT WORKDIR "C:\MyProject\scripts" OUTPUT "d:\nfs\hudson.log" &
尾部--pid=$! -f /nfs/hudson.log
You can use SSH instead of STAF for such task.
It seems with STAF it's a little bit tricky and could be done with OUTPUT option.
If you have shared storage, for example NFS share called /nfs on hudson server and d:\nfs on Windows, the following hudson job should work:
STAF $TESTMACHINE process start command ruby "C:\MyProject\scripts\MasterScript.rb" WAIT SAMECONSOLE RETURNSTDERR RETURNSTDOUT WORKDIR "C:\MyProject\scripts" OUTPUT "d:\nfs\hudson.log" &
tail --pid=$! -f /nfs/hudson.log