我已经安装了它,并设置了路径(C:\ Program Files \ Git \ bin \ git.exe)。我也尝试过本教程https://docs.microsoft.com/sl-si/azure/jenkins/install-jenkins-solution-template,但它也为我提供了此控制台输出。
我已经安装了它,设置了git路径,我仍然得到了它。我被困在这里几天了,我制作的每个版本都给我类似的错误消息。 我使用Windows 10计算机,并且在Azure上具有linux VM。
jenkins的azure节点上我的Free Swap空间表示为0B,但是有26,99GB的Free Temp Space。可能是这个问题吗?
无论如何,这是我完成的教程的控制台输出:
Started by user admin
Building remotely on testadminjenkinsazure115f10 (ubuntu) in workspace /home/Jenkinsadmin/workspace/mySampleApp
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Deferred wipeout is used...
[WS-CLEANUP] Done
Cloning the remote Git repository
Cloning repository https://github.com/spring-guides/gs-spring-boot.git
> C:\Program Files\Git\bin\git.exe init /home/Jenkinsadmin/workspace/mySampleApp # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init /home/Jenkinsadmin/workspace/mySampleApp
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:787)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:579)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
at hudson.remoting.UserRequest.perform(UserRequest.java:212)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to testadminjenkinsazure115f10
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
at hudson.remoting.Channel.call(Channel.java:955)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
at sun.reflect.GeneratedMethodAccessor870.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
at com.sun.proxy.$Proxy222.execute(Unknown Source)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1146)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186)
at hudson.scm.SCM.checkout(SCM.java:504)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
at hudson.model.Run.execute(Run.java:1810)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by: hudson.plugins.git.GitException: Error performing command: C:\Program Files\Git\bin\git.exe init /home/Jenkinsadmin/workspace/mySampleApp
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2023)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1984)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1980)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1612)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:785)
... 11 more
Caused by: java.io.IOException: Cannot run program "C:\Program Files\Git\bin\git.exe" (in directory "/home/Jenkinsadmin/workspace/mySampleApp"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.<init>(Proc.java:249)
at hudson.Proc$LocalProc.<init>(Proc.java:218)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:936)
at hudson.Launcher$ProcStarter.start(Launcher.java:455)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2012)
... 15 more
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 20 more
ERROR: Error cloning remote repo 'origin'
Finished: FAILURE
答案 0 :(得分:1)
您的Jenkins已在本地Windows-10中进行配置,但您向我们展示了一个链接,该链接可用于从Azure门户在Azure Linux VM上创建Jenkins服务器。我觉得你有些困惑。
关于Azure的基本基础架构的建议是:
在Windows 10中,您只需要使用git推送更改即可。
我对Jenkins,源代码存储库和您的应用程序服务器之间的基本集成的建议可能是:
https://stackoverflow.com/a/53835514/3957754
现在,以前的流程或集成很常见。当然,存在更复杂的方法,例如:kubernetes,ansible,工件存储库,jenkinsX等,或具有最少配置的saas提供程序,例如:jelastic,heroku,openshift等
答案 1 :(得分:0)
从您的信息和日志中,我看到您已经在Windows计算机上配置了主Jenkins,但是尝试在Ubuntu代理上远程运行该作业:
Building remotely on testadminjenkinsazure115f10 (ubuntu) in workspace /home/Jenkinsadmin/workspace/mySampleApp
因此,您需要在Ubuntu VM上安装Git。正如JRichardsz所说的那样,您只需要从Windows将更改推送到Git服务器即可。