Jenkins + git:“告诉我你是谁”错误,为什么它需要标记? [英] Jenkins + git: "tell me who you are" error, why does it need to tag?

查看:2104
本文介绍了Jenkins + git:“告诉我你是谁”错误,为什么它需要标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚刚在Ubuntu 12.04中安装了Jenkins,我想创建一个简单的构建,只需克隆一个项目并构建它。



它失败是因为它无法标记。它无法标记,因为它错误地指出告诉我你是谁,显然是因为我没有设置UserName和UserEmail的git设置。



但是,我不需要设置它们,詹金斯只会克隆存储库,为什么它需要凭据,如果它不会推动更改,为什么它需要做一个标记呢?



完整的错误日志是:

$ p $ 由用户匿名
开始签出:工作区/ /var/lib/jenkins/jobs/Foo.Bar.Baz/workspace - hudson.remoting.LocalChannel@38e609c9
使用策略:默认
克隆远程Git存储库
克隆存储库原点
从git@mygithost.mydomain.local获取上游变更:foo-bar-baz / foo-bar-baz.git
在repository origin / 1.0中查看分支
在repository origin / 1.5中查看分支。 4
仓库原产地中的可见分支/ HEAD
仓库原产地/主仓库中的可见分支
开始构建版本479d37776b46283a946dd395c1ea78f18c0b97 c7(origin / 1.0)
检出版本479d37776b46283a946dd395c1ea78f18c0b97c7(origin / 1.0)
致命错误:无法应用标记jenkins-Foo.Bar.Baz-2
hudson.plugins.git.GitException:无法在hudson.plugins.git.GitAPI.tag(GitAPI.java:737)上应用标记jenkins-Foo.Bar.Baz-2
hudson.plugins.git.GitSCM
$ 4.invoke( GitSCM.java:1320)
at hudson.plugins.git.GitSCM $ 4.invoke(GitSCM.java:1268)
at hudson.FilePath.act(FilePath.java:758)
at hudson.FilePath.act(FilePath.java:740)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1268)
at hudson.model.AbstractProject.checkout(AbstractProject.java: 1193)
at hudson.model.AbstractBuild $ AbstractRunner.checkout(AbstractBuild.java:565)
at hudson.model.AbstractBuild $ AbstractRunner.run(AbstractBuild.java:453)
at hudson .model.Run.run(Run.java:1376)
at hudson.matrix.MatrixBuild.run(MatrixBuild.java:220)
at hudson.model.ResourceController.execute(ResourceController.java:88 )$ h
在hudson.model.Ex ecutor.run(Executor.java:175)
在hudson.model.OneOffExecutor.run(OneOffExecutor.java:66)
引起:hudson.plugins.git.GitException:命令git tag -a -f -m Jenkins Build#2 jenkins-Foo.Bar.Baz-2返回状态码128:
stdout:$ b $ stderr:
***请告诉我你是谁。

运行

git config --global user.emailyou@example.com
git config --global user.nameYour Name

来设置您的帐户的默认身份。
省略--global仅在此存储库中设置标识。

致命的:空的ident< jenkins @ somehostname。(none)>不允许

at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:786)
at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:748)
at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:758)
at hudson.plugins.git.GitAPI.tag(GitAPI.java:735)
... 13 more


解决方案

标记拉取/克隆回购时的想法很常见到大多数Build Scheduler那里:

Hudson-Jenkins,但也 CruiseControl (由 labelincrementer 确定的构建标签)或

这个想法是将一个输入的持久记录设置为一个构建。

这样,你正在拖动的代码,即使它没有被标记,也会被构建调度器自动为你标记,以便能够在以后返回到特定的构建。



如果该策略(总是在构建之前标记),那么Jenkins需要知道你是谁以创建一个git标签(它是一个附有作者的git对象: user.name user.email )。



然而,正如为什么哈德森/詹金斯试图提交?


高级... 跳过内部标签 $ c>部分中的源代码管理


这应该避免额外的标记步骤,您似乎不需要。


Just installed Jenkins in Ubuntu 12.04 and I wanted to create a simple build that just clones a project and builds it.

It fails because it cannot tag. It cannot tag because it errors out saying "tell me who you are" apparently because I didn't set git settings UserName and UserEmail.

But, I should not need to set those, Jenkins is going to just clone the repository, why does it need the credentials if it's not going to push changes, why does it need to do a tag at all?

Full error log is:

Started by user anonymous
Checkout:workspace / /var/lib/jenkins/jobs/Foo.Bar.Baz/workspace - hudson.remoting.LocalChannel@38e609c9
Using strategy: Default
Cloning the remote Git repository
Cloning repository origin
Fetching upstream changes from git@mygithost.mydomain.local:foo-bar-baz/foo-bar-baz.git
Seen branch in repository origin/1.0
Seen branch in repository origin/1.5.4
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Commencing build of Revision 479d37776b46283a946dd395c1ea78f18c0b97c7 (origin/1.0)
Checking out Revision 479d37776b46283a946dd395c1ea78f18c0b97c7 (origin/1.0)
FATAL: Could not apply tag jenkins-Foo.Bar.Baz-2
hudson.plugins.git.GitException: Could not apply tag jenkins-Foo.Bar.Baz-2
at hudson.plugins.git.GitAPI.tag(GitAPI.java:737)
at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1320)
at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1268)
at hudson.FilePath.act(FilePath.java:758)
at hudson.FilePath.act(FilePath.java:740)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1268)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1193)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:565)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:453)
at hudson.model.Run.run(Run.java:1376)
at hudson.matrix.MatrixBuild.run(MatrixBuild.java:220)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:175)
at hudson.model.OneOffExecutor.run(OneOffExecutor.java:66)
Caused by: hudson.plugins.git.GitException: Command "git tag -a -f -m Jenkins Build #2 jenkins-Foo.Bar.Baz-2" returned status code 128:
stdout: 
stderr: 
*** Please tell me who you are.

    Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident  <jenkins@somehostname.(none)> not allowed

    at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:786)
    at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:748)
    at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:758)
    at hudson.plugins.git.GitAPI.tag(GitAPI.java:735)
    ... 13 more

解决方案

The idea of tagging when pulling/cloning a repo is common to most Build Scheduler out there:
Hudson-Jenkins, but also CruiseControl (The build label determined by the labelincrementer), or RTC Jazz Build Engine (where they are called "snapshots").

The idea is to set a persistent record of the input to a build.
That way, the code you are pulling, even if it wasn't tagged, is tagged automatically for you by the build scheduler, in order to be able to get back to that specific build later.

If that policy (always tagging before a build) is set, then Jenkins will need to know who you are in order to make a git tag (it is a git object with an author attached to it: user.name and user.email).

However, as mentioned in " Why hudson/jenkins tries to make commit? ":

Checks "Skip internal tag" config under "Advanced..." in section "Source code management".

That should avoid that extra tagging step you appear to not need.

这篇关于Jenkins + git:“告诉我你是谁”错误,为什么它需要标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆