Jenkins和Gitlab不获取代码 [英] Jenkins and Gitlab don't fetch code
本文介绍了Jenkins和Gitlab不获取代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
设置自己的项目时出现问题. 我开始配置我的Jenkins作业,并且这样做:
I have a problem when i set my own project. I start to configure my Jenkins Job, and I done this:
- 在詹金斯上为gitlab用户帐户创建凭据
- 在gitlab上创建访问令牌,并在Jenkins中使用此令牌启用它
这是作业配置
但是当我开始构建时,十分钟后我得到了这个错误
but when i start a build, after10 minutes i get this error
Started by user admin
Building in workspace /Users/Shared/Jenkins/Home/workspace/xxxxxxxxx
> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.origin.url https://gitlab.xxxxxxxxx.git # timeout=10
Fetching upstream changes from https://xxxxxxxx.git
> /usr/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials
> /usr/bin/git fetch --tags --progress https://xxxxxxxxxx.git +refs/heads/*:refs/remotes/origin/*
ERROR: Timeout after 10 minutes
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://gitlab.xxxxxxx.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:825)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1092)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1123)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1212)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:566)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:491)
at hudson.model.Run.execute(Run.java:1737)
at hudson.matrix.MatrixBuild.run(MatrixBuild.java:314)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --progress https://xxxxxxxx.git +refs/heads/*:refs/remotes/origin/*" returned status code 143:
stdout:
stderr:
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1970)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1689)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:380)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:823)
... 11 more
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE
那么...我该如何解决呢?
So... how do i solve this?
推荐答案
I think to solve the question. Follow this guide to add and enable jenkins user http://www.cimgf.com/2015/05/26/setting-up-jenkins-ci-on-a-mac-2/
,并且目前有效.谢谢大家
and, at the moment, works. Thanks all
这篇关于Jenkins和Gitlab不获取代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文