【发布时间】:2018-12-22 21:37:46
【问题描述】:
我已经安装并设置了路径(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 节点上的可用交换空间显示为 0B,但有 26,99GB 的可用临时空间。可能是这个问题吗?
无论如何,这是我完成的教程的控制台输出:
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
【问题讨论】:
-
欢迎来到 S.O!您是否使用 windows 开发和 Linux for Jenkins?这是来自 Jenkins 工作构建的日志吗?
-
我正在为 jenkins 使用 windows 10 机器,在 Azure 上使用 linux (ubuntu) 虚拟机。是的,我想在 azure 上的虚拟机上建立一个工作。
-
您当前的方法是概念证明吗?在真实的软件环境中,您至少需要:#1 开发人员机器#2 为您的 Jenkins(看在上帝的份上是 linux)服务器和#3 一些服务器用于您的应用程序部署。开发者只需将代码推送到 git,Jenkins 就会收到此事件的通知,触发在远程应用服务器上构建预配置作业。
-
回到最初的问题。 #1 你是否有一个包含某些应用程序(java、ruby、python 等)源代码的 git 存储库? # 您是否需要使用本地 Jenkins (windows 10) 将此源代码作为应用程序部署在 Azure 上的 linux (ubuntu) 虚拟机中?
-
是的,我需要将源代码部署在Azure上的虚拟机中,并且我想使用我本地的Jenkins。如您所见,我是第一次这样做。您是否有我可以遵循的教程?谢谢你
标签: git azure jenkins virtual-machine jenkins-plugins