如何在jenkins中的Windows批处理命令中运行命令 [英] How to run command in windows batch Command in jenkins

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

问题描述

我试图在执行Windows批处理命令中运行命令的构建步骤下,在Jenkins中运行命令.

I am trying to run a command in Jenkins under build step of running commands in Execute windows batch command.

我写了dir作为命令来运行

I wrote dir to run as a command

并且显示作业在Jenkins中运行时,该错误是由文件内容更改引起的,随后出现错误

and when the job runs in Jenkins which is triggered by a change in content of a file following error is shown

[FSTrigger] Triggered by a change to a file (<a href="triggerCauseAction">log</a>)
Building in workspace C:\Users\Pankaj\.jenkins\jobs\convert File to text form\workspace
FATAL: null
java.util.NoSuchElementException
at java.util.TreeMap$PrivateEntryIterator.nextEntry(Unknown Source)
at java.util.TreeMap$EntryIterator.next(Unknown Source)
at java.util.TreeMap$EntryIterator.next(Unknown Source)
at java.util.TreeMap.buildFromSorted(Unknown Source)
at java.util.TreeMap.buildFromSorted(Unknown Source)
at java.util.TreeMap.buildFromSorted(Unknown Source)
at java.util.TreeMap.buildFromSorted(Unknown Source)
at java.util.TreeMap.buildFromSorted(Unknown Source)
at java.util.TreeMap.buildFromSorted(Unknown Source)
at java.util.TreeMap.putAll(Unknown Source)
at hudson.EnvVars.<init>(EnvVars.java:82)
at hudson.EnvVars$GetEnvVars.call(EnvVars.java:207)
at hudson.EnvVars$GetEnvVars.call(EnvVars.java:205)
at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
at hudson.EnvVars.getRemote(EnvVars.java:202)
at hudson.model.Computer.getEnvironment(Computer.java:837)
at hudson.model.Run.getEnvironment(Run.java:1883)
at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:836)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:75)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710)
at hudson.model.Build$RunnerImpl.build(Build.java:178)
at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480)
at hudson.model.Run.run(Run.java:1434)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:239)

请参阅此问题.

推荐答案

此问题的答案: 实际上,我还没有在Jenkins中将Windows安装为服务.因此,为此,我们需要转到管理Jenkins",然后单击"Windows即服务".即,将Jenkins作为Windows服务安装.

Answer to this question: Actually i haven't installed Windows as a service in Jenkins. So for this we need to go to "manage Jenkins" and then click on "windows as a service".I.e Installing Jenkins as a windows service.

这篇关于如何在jenkins中的Windows批处理命令中运行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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