简体   繁体   English

Jenkins 调用需要 windows 环境变量的批处理文件。 bat 文件不可编辑

[英]Jenkins calls batch file which needs windows environment variables. Bat file is uneditable

Basically Jenkins is calling a bat file which is proprietary and does some compilation.基本上,詹金斯正在调用一个专有的 bat 文件并进行一些编译。

Calling the file directly from command prompt works fine.直接从命令提示符调用文件工作正常。 However when Jenkins calls the bat file it cannot find environment variables it needs and an error is thrown that the value is unknown.但是,当 Jenkins 调用 bat 文件时,它找不到它需要的环境变量,并且会抛出一个值未知的错误。

I know if I could edit the bat file I could circumvent the issue, but the file is proprietary so that is not an option.我知道如果我可以编辑 bat 文件,我可以绕过这个问题,但该文件是专有的,所以这不是一个选项。 Any thoughts?有什么想法吗?

Disclaimer: Been a while since I used it (and Jenkins).免责声明:自从我使用它(和詹金斯)以来已经有一段时间了。

Back in the day we did this with the EnvInject plugin.回到过去,我们使用EnvInject插件做到了这一点。 Worked quite well as far as I remember it.据我记得,工作得很好。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM