Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 如何从Jenkins运行批处理文件_Batch File_Jenkins_Cmd - Fatal编程技术网

Batch file 如何从Jenkins运行批处理文件

Batch file 如何从Jenkins运行批处理文件,batch-file,jenkins,cmd,Batch File,Jenkins,Cmd,我试图运行Jenkins的批处理文件,但无法运行。 在预构建步骤中,我输入了要执行的文件,但得到了如下所示的stacktrace。詹金斯无法识别cmd命令 我怎样才能解决这个问题 Started by user Jenkins [EnvInject] - Loading node environment variables. Building in workspace /srv/jenkins/workspace/gaa-integratietest-daily > git rev-pa

我试图运行Jenkins的批处理文件,但无法运行。 在预构建步骤中,我输入了要执行的文件,但得到了如下所示的stacktrace。詹金斯无法识别cmd命令

我怎样才能解决这个问题

Started by user Jenkins
[EnvInject] - Loading node environment variables.
Building in workspace /srv/jenkins/workspace/gaa-integratietest-daily
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://git@poosgitl01.ont.belastingdienst.nl:7999/gaa/gaa_test_milieu.git # timeout=10
Fetching upstream changes from ssh://git@poosgitl01.ont.belastingdienst.nl:7999/gaa/gaa_test_milieu.git
 > git --version # timeout=10
 > git -c core.askpass=true fetch --tags --progress ssh://git@poosgitl01.ont.belastingdienst.nl:7999/gaa/gaa_test_milieu.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse origin/develop^{commit} # timeout=10
Checking out Revision 337d5b94e05f2c915e05de2c2535d5af180d4326 (origin/develop)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 337d5b94e05f2c915e05de2c2535d5af180d4326
 > git rev-list 337d5b94e05f2c915e05de2c2535d5af180d4326 # timeout=10
[gaa-integratietest-daily] $ /bin/sh -xe /tmp/hudson1965771098535657790.sh
+ cmd /c qclient.bat
/tmp/hudson1965771098535657790.sh: line 2: cmd: command not found
Build step 'Execute shell' marked build as failure
[gaa-integratietest-daily] $ /usr/share/maven/bin/mvn -f pom.xml -gs /srv/maven/settings.xml clean deploy -fae
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project  (/srv/jenkins/workspace/gaa-integratietest-daily/pom.xml) has 1 error
[ERROR]     Non-readable POM /srv/jenkins/workspace/gaa-integratietest-daily/pom.xml: /srv/jenkins/workspace/gaa-integratietest-daily/pom.xml (No such file or directory)
[ERROR] 

您正在尝试在LINUX计算机上运行CMD。将正在运行的从机更改为Windows计算机,或将批处理脚本迁移为shell脚本


祝你好运

您正在尝试在LINUX计算机上运行CMD。将正在运行的从机更改为Windows计算机,或将批处理脚本迁移为shell脚本


祝你好运

您的Linux Jenkins slave不支持cmd。为了解决这个问题,您有几种选择(从好到坏):

  • 向Jenkins添加一个Windows从属服务器并从那里运行cmd
  • 将批处理文件移植到bash或类似版本,并从Linux-Jenkins从机运行它
  • 在Linux Jenkins从机中添加某种DOS仿真器(Wine、DOSBox、DOSemu)

  • 我的建议:如果你知道Linux和Bash,或者你无法控制Jenkins那么选择选项2。否则,选择选项1。避免选项3。

    您的Linux Jenkins slave不支持cmd。为了解决这个问题,您有几种选择(从好到坏):

  • 向Jenkins添加一个Windows从属服务器并从那里运行cmd
  • 将批处理文件移植到bash或类似版本,并从Linux-Jenkins从机运行它
  • 在Linux Jenkins从机中添加某种DOS仿真器(Wine、DOSBox、DOSemu)
  • 我的建议:如果你知道Linux和Bash,或者你无法控制Jenkins那么选择选项2。否则,选择选项1。避免选择3