简体   繁体   English

在Windows Shell中的Jenkins中使用Linux命令

[英]Use of linux commands in Jenkins in windows shell

In the build step section of the project configuration pane I have the possibility to execute a windows batch command . 在项目配置窗格的“ 构建步骤”部分中,我可以执行Windows批处理命令

Is there any way to use this to execute linux commands? 有什么方法可以用来执行linux命令吗? Is there any other way? 还有其他办法吗?

You can run scripts in Cygwin: 您可以在Cygwin中运行脚本:

https://www.cygwin.com/ https://www.cygwin.com/

Like the following: 如下所示:

C:\\cygwin\\bin\\bash mysript.sh C:\\ cygwin \\ bin \\ bash mysript.sh

The purpose of Cygwin is to make porting unix-based applications to Windows much easier, by emulating the POSIX layer through the cygwin1.dll Cygwin的目的是通过cygwin1.dll模拟POSIX层,从而使基于Unix的应用程序到Windows的移植更加容易。

The equivalent build step for Linux is "Execute shell". Linux的等效构建步骤是“ Execute shell”。 Of course the job needs to execute on a Linux machine for it to work. 当然,这项工作需要在Linux机器上执行才能工作。

If you want to execute Linux commands on a Windows slave, then use Cygwin or MinGW as others have suggested. 如果要在Windows从站上执行Linux命令,请按照其他建议使用Cygwin或MinGW。

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

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