詹金斯执行Windows批处理路径问题,并重定向输出 [英] Jenkins execute windows batch Path issue and redirected output

查看:204
本文介绍了詹金斯执行Windows批处理路径问题,并重定向输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个Windows脚本的蝙蝠,在窗口工作正常。当詹金斯下运行,我们需要运行嵌入式程序中引用的字符串这将导致输出仅被看作直到命令完成后。当一个真正的Windows运行cmd.exe的输出出来的时候发现该文本将继续运行。
我们看到该程序的路径目录中,我们也执行之前添加路径声明。 C:\\ MyPrograms \\;%PATH%。
是什么原因导致詹金斯保存输出到执行完成?为什么该计划已被当程序在路径中引用后?我们正在使用SVN | grep和我们得到prorgam没有找到,除非它是完整路径带引号的字符串。
C:\\龟\\ Svn.exe参数parms |C:\\ Myprogram \\ grep.exe串的作品,没有输出,直到结束。
C:\\龟\\ Svn.exe参数parms | grep.exe串prorgam \\命令时未找到路径回声%PATH%指令visibble。任何想法?

We have a windows bat script that works fine in windows. When run under Jenkins we have to run the embedded program in quoted string this causes the output to only be seen till after completion of the command. When run in a real windows cmd.exe the output come out when the text is found continues to run. We see the program is in the path directory and we also add the path statement before execution. "C:\MyPrograms\;%path%". What causes Jenkins to save the output till after execution completes and why does the program have to be quoted when the program is in the path? We are using SVN | Grep and we get prorgam not found unless its is a quoted string with full path. "c:\Tortoise\Svn.exe parms | "C:\Myprogram\grep.exe" "string" " works with no output till the end. c:\Tortoise\Svn.exe parms | grep.exe "string" prorgam\command not found when the path is visibble in the echo "%path% command. Any ideas?

推荐答案

如何,更重要的您设置路径?由于工作或工作?

How and more importantly when are you setting the path? As part of the job or as a separate step outside the job?

在任何情况下,你写道:的C:\\ MyPrograms \\;%PATH%的结果
首先,我希望这是你一个错字,但你需要冒号()。在 C < BR>
其次,你设置了设置命令的路径,像这样:结果
设置PATH =%PATH%; C:\\ MyPrograms

In any case, you wrote: "C\MyPrograms\;%path%"
First, I hope it is a typo on your part, but you need the colon (:) after C.
Second, you set the path with a set command, like so:
set PATH=%PATH%;C:\MyPrograms

现在的重要组成部分。在命令行设置的路径像这样的不是永久性的并只会持续为这个的cmd.exe 会话的持续时间。所以,如果你正在做这个作为工作的一部分,那么这很好。但是,如果你是单独的命令行这样做,这是不是永久性的,不可用时,詹金斯运行。

Now the important part. Setting the path like this from command line is not permanent and will only last for the duration of this cmd.exe session. So, if you are doing this as part of the job, then that's fine. But if you are doing it separately from command line, that is not permanent and not available when Jenkins runs.

您可以永久在这里<后续的答案设置系统路径href=\"http://superuser.com/questions/317631/setting-path-in-windows-7-command-prompt\">http://superuser.com/questions/317631/setting-path-in-windows-7-command-prompt

这篇关于詹金斯执行Windows批处理路径问题,并重定向输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆