Jenkins集成gitee遇到的问题及解决方案

首先贴问题

# 以下带有敏感信息的我都打*了
Started by Gitee push by Gitee
Running as SYSTEM
Building in workspace /root/.jenkins/workspace/text
The recommended git tool is: NONE
using credential ******
 > /usr/local/git/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > /usr/local/git/bin/git config remote.origin.url https://gitee.com/*****/ecarport.git # timeout=10
Fetching upstream changes from https://gitee.com/handsome_little_brother_hao/ecarport.git
 > /usr/local/git/bin/git --version # timeout=10
 > git --version # 'git version 2.23.0'
using GIT_ASKPASS to set credentials 
 > /usr/local/git/bin/git fetch --tags --force --progress -- https://gitee.com/handsome_little_brother_hao/ecarport.git +refs/heads/master:refs/remotes/origin/master +refs/pull/*/MERGE:refs/pull/*/MERGE # timeout=10
 > /usr/local/git/bin/git rev-parse remotes/origin/test_version^{commit} # timeout=10
FATAL: Command "/usr/local/git/bin/git rev-parse remotes/origin/test_version^{commit}" returned status code 128:
stdout: remotes/origin/test_version^{commit}

stderr: fatal: ambiguous argument 'remotes/origin/test_version^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

hudson.plugins.git.GitException: Command "/usr/local/git/bin/git rev-parse remotes/origin/test_version^{commit}" returned status code 128:
stdout: remotes/origin/test_version^{commit}

stderr: fatal: ambiguous argument 'remotes/origin/test_version^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2380)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2376)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1923)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1935)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:1037)
	at hudson.plugins.git.GitAPI.revParse(GitAPI.java:331)
	at hudson.plugins.git.RevisionParameterAction.toRevision(RevisionParameterAction.java:98)
	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1137)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1300)
	at hudson.scm.SCM.checkout(SCM.java:505)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1206)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:637)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:509)
	at hudson.model.Run.execute(Run.java:1907)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE

解决方案

1.如果是从gitee webhook 点击测试,只是测试一个连通性问题,webhook带过来的数据不一定能成功构建,

可以试试推送代码或者提交PR来触发,如果你点击测试了gitee没报错但是Jenkins报了以上错误那你可以试试推送代码,我推送代码就🆗了

2.jenkins 的git 源码管理插件新版本有变化,Refspec 不支持多个条目同时使用通配符。

那就可以去这里查看你的写法是否正确 地址写法可以参考我下面这个 全部用*是不行的

+refs/heads/master:refs/remotes/origin/master
+refs/pull/*/MERGE:refs/pull/*/MERGE

效果图在这里插入图片描述

最后可能就是你其他地方没些对 可以去官方文档看看

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值