Jenkins 的 Gerrit 触发器找不到任何要构建的修订

2024-05-02

我在使用 Jenkins+Gerrit 时遇到问题。

这是我到目前为止得到的:

  • Jenkins 中的 Gerrit 触发器配置似乎没问题:当我推送新的变更集时,Jenkins 构建就会启动。

  • 我用过这个:Jenkins:Gerrit 触发器问题的设置 https://stackoverflow.com/questions/7582331/jenkins-settings-for-gerrit-trigger-problems也能够“手动”启动它。

  • 至于我的配置,我有 像这样的东西:https://stackoverflow.com/a/18347982/2248987 https://stackoverflow.com/a/18347982/2248987。分支说明符为 $GERRIT_BRANCH,参考规范为 $GERRIT_REFSPEC

  • Gerrit 和 Git 各自的工作都很好。访问似乎也还可以。

这是我的问题。构建时(gerrit触发或手动),日志输出为:

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://user@host:29418/testproject # timeout=10
Fetching upstream changes from ssh://user@host:29418/testproject
 > git --version # timeout=10
using GIT_SSH to set credentials 
 > git -c core.askpass=true fetch --tags --progress ssh://user@host:29418/testproject refs/heads/master
 > git rev-parse origin/$GERRIT_BRANCH^{commit} # timeout=10
 > git rev-parse $GERRIT_BRANCH^{commit} # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE

我被这条消息困住了,尝试了空仓库、非空仓库,以及带有或不带有“审查中”变更集


我曾经遇到过这个问题,我想我现在已经解决了它,我责怪 Jenkins UI 隐藏了一些基本的配置元素;)

这是修复之前我的 Jenkins 构建的输出:

Triggered by Gerrit: https://bbpcode.epfl.ch/code/15056
[EnvInject] - Loading node environment variables.
Building remotely on rh6.6-02 (amd64-RedHatEnterpriseServer 6.6 RedHatEnterpriseServer amd64-RedHatEnterpriseServer-6.6 rh6.x RedHatEnterpriseServer-6.6 amd64) in workspace /var/tmp/jenkins/workspace/datamining.nip-commons.gerrit
 > /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 ssh://bbpcode.epfl.ch/datamining/nip-commons # timeout=10
Fetching upstream changes from ssh://bbpcode.epfl.ch/datamining/nip-commons
 > /usr/bin/git --version # timeout=10
 > /usr/bin/git fetch --tags --progress ssh://bbpcode.epfl.ch/datamining/nip-commons +refs/heads/*:refs/remotes/origin/*
 > /usr/bin/git rev-parse 74e4ff18f54bd6e046f7af016614193f566adfe4^{commit} # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Finished: FAILURE

SOLUTION

您需要打开构建配置并转到“源代码管理”部分,如下所示:

现在您会注意到有一个“高级”按钮,单击它以显示额外的字段,如下所示:

现在您可以在此处输入您的参考规范:$GERRIT_REFSPEC

现在,要么重新触发失败的构建,要么放弃审核并提交新的审核,它应该可以正常工作。

现在我们有了适当的 refspec,这是 Jenkins 作业的输出:

Retriggered by user kerrien for Gerrit: https://bbpcode.epfl.ch/code/15056
[EnvInject] - Loading node environment variables.
Building remotely on rh6.6-02 (amd64-RedHatEnterpriseServer 6.6 RedHatEnterpriseServer amd64-RedHatEnterpriseServer-6.6 rh6.x RedHatEnterpriseServer-6.6 amd64) in workspace /var/tmp/jenkins/workspace/datamining.nip-commons.gerrit
 > /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 ssh://bbpcode.epfl.ch/datamining/nip-commons # timeout=10
Fetching upstream changes from ssh://bbpcode.epfl.ch/datamining/nip-commons
 > /usr/bin/git --version # timeout=10
 > /usr/bin/git fetch --tags --progress ssh://bbpcode.epfl.ch/datamining/nip-commons refs/changes/56/15056/2
 > /usr/bin/git rev-parse 74e4ff18f54bd6e046f7af016614193f566adfe4^{commit} # timeout=10
Checking out Revision 74e4ff18f54bd6e046f7af016614193f566adfe4 (dev)
 > /usr/bin/git config core.sparsecheckout # timeout=10
 > /usr/bin/git checkout -f 74e4ff18f54bd6e046f7af016614193f566adfe4
 > /usr/bin/git rev-parse FETCH_HEAD^{commit} # timeout=10
 > /usr/bin/git rev-list 2649d51369413cef4dfb7ec50939945005514cfa # timeout=10
Cleaning workspace
 > /usr/bin/git rev-parse --verify HEAD # timeout=10
Resetting working tree
 > /usr/bin/git reset --hard # timeout=10
 > /usr/bin/git clean -fdx # timeout=10
Triggering datamining.nip-commons.gerrit » default
datamining.nip-commons.gerrit » default completed with result SUCCESS
Started calculate disk usage of build
Finished Calculation of disk usage of build in  2 second
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Finished: SUCCESS
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Jenkins 的 Gerrit 触发器找不到任何要构建的修订 的相关文章

  • 拉取请求是 Git 的一部分,还是 GitHub、Gerrit 和 Atlassian Stash 等工具的功能?

    Pull 请求似乎是使用 Git 进行代码审查的常用方法 然而 尚不清楚该术语在使用内置函数时是否具有相同的含义 git request pull 或不同的工具 Pull 请求是 Git 的固有功能 还是 GitHub Gerrit 或 A
  • 删除 git 子模块 - 如何在拉取时自动删除?

    我读了如何自己删除 git 子模块 https stackoverflow com questions 1260748 how do i remove a git submodule Delete the relevant section
  • 如何从 TFS 获取类似 git 的统计信息

    我已经与 TFS 合作几个月了 希望获得一些基本统计数据并将其提供给我们的团队 在 git 中 我可以检索有关 按作者提交 和 按日期提交 等的统计信息 我想显示来自 TFS 或来自 TeamCity 的类似统计数据 这可能吗 我发现研究
  • 如何在 Visual Studio 2013 中隐藏未提交的更改

    需要一些帮助 了解如何使用 Visual Studio 2013 搁置 Git 存储库中未提交的更改 我来自 PHPStorm 您可以在一个分支上搁置未提交的更改 切换到另一个分支并取消搁置 但是 我无法找到 了解如何在 Visual St
  • 使用两个帐户推送到 Git

    我跟着这个tuotrial http code tutsplus com tutorials how to work with github and multiple accounts net 22574关于如何在同一台计算机上拥有两个单独
  • git 分叉是如何工作的?

    所以我登录了 github 并 fork 了一个项目 每次原始存储库更新时 我的分叉存储库都会更新吗 或者我应该每次都从原始存储库进行分叉 这样我就不会错过对原始存储库所做的任何新更改 分叉是存储库的副本 分叉存储库允许您自由地尝试更改 而
  • Windows 中的 Git Shell:补丁的默认字符编码是 UCS-2 Little Endian - 如何将其更改为 ANSI 或 UTF-8 without BOM?

    当创建一个Windows 中使用 Git Shell 进行差异补丁 当使用适用于 Windows 的 GitHub http windows github com the 字符编码补丁的UCS 2 小尾数法根据Notepad 参见下面的屏幕
  • 是否应该在 git 中跟踪 .history 文件夹中的文件[关闭]

    Closed 这个问题是基于意见的 help closed questions 目前不接受答案 每当我进行更改时 history 文件夹中的某些文件在我的状态中都会显示为未跟踪 我将如何控制它 即 make 是自动添加或不添加这些内容 而不
  • GitLab CI - 添加标签时避免构建

    添加 git 标签时如何防止触发 gitlab ci 管道 我在本地运行此命令 而不是在 gitlab ci 作业中运行 git tag a xyz 然后推送标签 这会触发各种管道 我想排除其中一些管道的运行 我正在尝试对诸如以下问题的想法
  • 签出现有的远程分支

    我见过不同的方法来检查现有的远程分支 假设我的朋友推送了新分支 bigbug 并且我想签出并将我的本地工作副本切换到该分支 我有以下选项 1 git checkout b bigbug origin bigbug 2 git checkou
  • 如何损坏 Git 存储库?

    创建损坏的 git 存储库有哪些方法 有没有有趣的方法可以永久损坏 git 存储库 你能否削弱一个 git 存储库 使其行为有些正常 但会做一些奇怪的事情 我的兴趣来自于当有人担心他们是否真的创建了不可恢复的状态时 它通常很容易修复或至少可
  • 有关多个远程存储库的 Git 状态

    我有一个脚本 如果我忘记在 40 多个存储库中提交或推送一些代码 它会通过电子邮件向我发送提醒 在我的两个项目中 我遵循了这些帖子中的答案 其中我设置了 git push 来推送到多个存储库 从多个远程位置拉 推 https stackov
  • Python 无法在 git bash 命令行中工作

    Python 不会在 git bash Windows 中运行 当我在命令行中输入 python 时 它会将我带到一个空行 而不会像在 Powershell 中一样显示它已输入 python 2 7 10 它没有给我错误消息 但 pytho
  • Git refs/remotes/origin/master 没有指向有效的对象

    在上次合并到 Git 存储库的 master 分支后 我失去了克隆存储库的能力 Cloning into test repository remote Counting objects 126084 done remote Compress
  • 本地git,推送到tfs远程repo

    我厌倦了向我的队友解释使用 DVCS 相对于 CVCS 的好处 他们中的一些人害怕学习曲线 另一些人则看不出任何原因 因为对他们来说 这都是一样的 就我个人而言 我对 TFS 及其问题感到非常厌倦 每当我需要进行一些小的 修复 时 我都必须
  • 从 master 更改为新的默认分支 git

    这是一个场景 我们有一个默认的分支 Master 我们以此为基础 创建分支并向上推等等 我们现在创建了一个Develop分支Master并将其设置为默认开发分支 我想知道的是 我现在如何知道我的 git pull 命令是否通过命令行请求默认
  • 为什么在 Eclipse 中对 Egit 管理的项目禁用合并工具?

    根据Egit 用户指南 http wiki eclipse org EGit User Guide Using Merge Tool 要使用合并工具 应右键单击存在合并冲突的资源 然后选择Team gt 合并工具 但是 当我执行此操作时 合
  • 如何使用“gem install”命令从私有 GitHub 存储库安装 gem

    如何在本地安装托管在 GitHub 上的私人存储库中的 gem 特别是 我们通过gem install命令而不是在 Bundler 中使用 因为它是一个命令行工具 我尝试这样做 gem install githubname repo s h
  • 返回到存储库中的特定修订后提交并推送更改?

    我们需要及时返回到某个特定的提交 一些意外的改变是为了掌握 尝试恢复它挖得太深 所以 master 的状态很糟糕 现在我们希望master回到66ada4cc61d62afc 根据git 恢复到某个提交 https stackoverflo
  • git Branch -d :致命 - 无法查找 HEAD 的提交对象

    假设我在一个裸存储库 远程 中 如果我尝试使用以下命令删除分支git branch d

随机推荐