如何在Jenkins中的Windows Batch命令中运行命令

我正在尝试在执行Windows批处理命令中运行命令的构建步骤下在Jenkins中运行命令。

我写了dir作为命令运行

当作业在Jenkins中运行时,该错误是由文件内容更改触发的,并显示以下错误

[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服务安装。

以上是 如何在Jenkins中的Windows Batch命令中运行命令 的全部内容, 来源链接: utcz.com/qa/421988.html

回到顶部