JenkinsとPowerShellを統合しようとすると1 mmです。 PowerShellのスクリプトジョブが以下のように失敗しているので、このエラーを解決するのは難しいと思っています。Jenkinsエラー:JenkinsとのPowershellの統合
[own-machine-powershell-job] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "& 'C:\Windows\TEMP\hudson3566059468296731803.ps1'" The system cannot find the file specified FATAL: command execution failed java.io.IOException: Cannot run program "powershell.exe" (in directory "C:\jenkins\workspace\own-machine-powershell-job"): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.(Proc.java:244) at hudson.Proc$LocalProc.(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:816) at hudson.Launcher$ProcStarter.start(Launcher.java:382) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114) at hudson.remoting.UserRequest.perform(UserRequest.java:120) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:62) at java.lang.Thread.run(Unknown Source) at ......remote call to Powershell-Job(Native Method) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416) at hudson.remoting.UserResponse.retrieve(UserRequest.java:220) at hudson.remoting.Channel.call(Channel.java:781) at hudson.Launcher$RemoteLauncher.launch(Launcher.java:929) at hudson.Launcher$ProcStarter.start(Launcher.java:382) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:408) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.(Proc.java:244) at hudson.Proc$LocalProc.(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:816) at hudson.Launcher$ProcStarter.start(Launcher.java:382) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1149) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1114) at hudson.remoting.UserRequest.perform(UserRequest.java:120) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:62) at java.lang.Thread.run(Unknown Source) Build step 'Windows PowerShell' marked build as failure Finished: FAILURE
私は同じ問題に関して他の同様の記事を見ましたが、問題を解決することはできません。事前に感謝します – Nash
私はジェンキンスとの経験がなく、Windowsでジェンキンスと全く経験がありませんが、私の最初の推測はPATHの問題です。 'powershell.exe'は' C:\ Windows \ System32 \ WindowsPowerShell \ v1.0'にあります。あなたは完全な道でそれを呼び出すことを試みましたか? –
Jenkins内でスクリプトをどのように実行しようとしているかを示す必要があります。ジェンキンスのビルドステップのスクリーングラブが役立ちます。 – rrirower