如何在詹金斯中运行bat文件 [英] How to run bat file in jenkins

查看:2942
本文介绍了如何在詹金斯中运行bat文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的jenkins安装在C:\Program Files (x86)\Jenkins

My jenkins is installed in C:\Program Files (x86)\Jenkins

bat文件位于C:\Users\Admin\workspace\demoWork\run.bat

当我从cmd运行此bat文件时,一切正常.但是当我尝试从jenkins执行Image中提到的批处理命令时,Jenkins将错误显示为

When i run this bat file from cmd everything works fine. But when i try from jenkins executing batch command as mentioned in Image, Jenkins displays error as

构建步骤执行Windows批处理命令"将构建标记为失败

Build step 'Execute Windows batch command' marked build as failure

还自动在jenkins文件夹中创建带有职位名称的工作区文件夹.你们能详细解释一下吗?

Also inside jenkins folder automatically workspace folder gets created with Job title name. Can you guys please explain me in detail

推荐答案

Tatkal,您无法执行图像中的命令,

Tatkal, you can't execute a command like in your image,

为什么不简单尝试

C:\ users \ admin \ workspace \ demowork \ run.bat

C:\users\admin\workspace\demowork\run.bat

调用"C:\ users \ admin \ workspace \ demowork \ run.bat"

call "C:\users\admin\workspace\demowork\run.bat"

还自动在jenkins文件夹内创建带有职位名称的工作区文件夹.请您详细解释一下我"-

"Also inside jenkins folder automatically workspace folder gets created with Job title name. Can you guys please explain me in detail" -

Jenkins自动创建一个具有职位名称的文件夹,保存职位数据和其他构建信息...这就是它的工作方式.默认情况下,在jenkins作业中,您可以使用$ WORKSPACE变量访问工作区

Jenkins creates folder with job title name automatically, saves jobs data and other build info... this is how it works. By default in jenkins job you can access your workspace using $WORKSPACE variable

这篇关于如何在詹金斯中运行bat文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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