詹金斯将不会从一个.BAT正确地执行命令 [英] Jenkins won't execute correctly a command from a .bat

查看:469
本文介绍了詹金斯将不会从一个.BAT正确地执行命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了詹金斯这样,它建立我的项目,运行某些测试,然后创建一个包含报告的HTML页面。

我做了一个.bat文件在我的浏览器中打开HTML报告。有在.bat文件只有一行:

 E:\\用户\\ Visual Studio 2010的\\ JenkinsWorkspace \\ JobTest \\ index.html的

当我运行在该蝙蝠提示自己,在页面的index.html是开放的(所以它的工作原理)。

但问题是,当我设置了詹金斯的作业运行.BAT,什么都不会发生。
这项工作被卡住调用.BAT后无法完成。

任何想法,为什么?

请注意:我还有其他蝙蝠(即不打开HTML页)由詹金斯成功执行

编辑:这里是我的错误提示中的日志从詹金斯的菜单获得:


  

C:\\ Program Files文件\\詹金斯\\ \\工作JobTest2_enUnSeulScript \\工作区>回声
  打开HTML页面,>>打开HTML页面


  
  

C:\\ PROGRAM
  文件\\詹金斯\\ \\工作JobTest2_enUnSeulScript \\工作区>C:\\ PROGRAM
  FILES \\谷歌\\铬\\应用\\的chrome.exe,E:\\用户\\视觉
  Studio 2010的\\ JenkinsWorkspace \\ JobTest \\ testResults.14h05m15s65ms.11.04.2013.trx.htm
  [688:3900:0411/140520:ERROR:gpu_info_collector_win.cc(96)]不能
  检索有效的WinSAT评估。结果
  [688:3900:0411/140520:ERROR:process_singleton_win.cc(540)]锁定文件
  无法创建!错误code:32结果
  [688:3900:0411/140520:ERROR:chrome_browser_main.cc(1157)]以失败
  为您的个人资料目录中ProcessSingleton。这意味着
  运行多个实例将启动多个浏览器进程
  而不是在现有的过程打开一个新的窗口。现在中止
  避免的配置文件损坏。结果
  构建步骤执行者UNE LIGNE德COMMANDE一批Windows的标示建设成为失败[htmlpublisher]结果
  归档HTML报告... [htmlpublisher]项目一级存档
  E:\\用户\\ Visual Studio 2010的\\ JenkinsWorkspace \\ JobTest到C:\\ PROGRAM
  文件\\詹金斯\\工作\\ JobTest2_enUnSeulScript \\ htmlreports \\ HTML_Tests_Report
  成品:未能



解决方案

如果您正在运行詹金斯作为一个窗口的服务,您可能需要启用该服务与桌面交互。做到以下几点:


  1. 打开服务模块

  2. 在詹金斯单击鼠标右键,选择属性

  3. 在登录选项卡,运行为本地系统帐户,选择允许服务与桌面交互复选框

- 或 -

您可以通过命令行运行詹金斯。即:Java的罐子jenkins.war

I have set up Jenkins so that it builds my project, runs some tests and then creates an HTML page containing a report.

I made a .bat file to open the html report in my browser. There is just one line in that .bat file :

"E:\user\Visual Studio 2010\JenkinsWorkspace\JobTest\index.html"

When I run that .bat in a prompt myself, the page index.html is open (so it works).

But the problem is that when I set up a Jenkins' job to run that .bat, nothing happens. The job gets stuck after calling the .bat and never finishes.

Any idea why?

Note: I have other .bat (that do not open html pages) that are successfully executed by Jenkins.

EDIT: here is the errors I get in the prompt log from Jenkins's menu :

C:\Program Files\Jenkins\jobs\JobTest2_enUnSeulScript\workspace>echo " Opening html page" " >> Opening html page"

C:\Program Files\Jenkins\jobs\JobTest2_enUnSeulScript\workspace>"C:\Program Files\Google\Chrome\Application\chrome.exe" "E:\user\Visual Studio 2010\JenkinsWorkspace\JobTest\testResults.14h05m15s65ms.11.04.2013.trx.htm" [688:3900:0411/140520:ERROR:gpu_info_collector_win.cc(96)] Can't retrieve a valid WinSAT assessment.
[688:3900:0411/140520:ERROR:process_singleton_win.cc(540)] Lock file can not be created! Error code: 32
[688:3900:0411/140520:ERROR:chrome_browser_main.cc(1157)] Failed to create a ProcessSingleton for your profile directory. This means that running multiple instances would start multiple browser processes rather than opening a new window in the existing process. Aborting now to avoid profile corruption.
Build step 'Exécuter une ligne de commande batch Windows' marked build as failure [htmlpublisher]
Archiving HTML reports... [htmlpublisher] Archiving at PROJECT level E:\user\Visual Studio 2010\JenkinsWorkspace\JobTest to C:\Program Files\Jenkins\jobs\JobTest2_enUnSeulScript\htmlreports\HTML_Tests_Report Finished: FAILURE

解决方案

If you are running Jenkins as a Window's service, you will probably need to enable the service to interact with the desktop. Do the following:

  1. Open the Services module
  2. Right-click on Jenkins and select "Properties"
  3. On the "Log On" tab, run as "Local System account" and select the "Allow service to interact with desktop" checkbox

-- OR --

You can run Jenkins via the command-line. Ie: "java -jar jenkins.war".

这篇关于詹金斯将不会从一个.BAT正确地执行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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