保存的Git SHA1哈德森建立类似于CVS的CVS_BRANCH标记时 [英] Saving Git SHA1 when building with Hudson similar to the CVS_BRANCH tag for CVS

查看:135
本文介绍了保存的Git SHA1哈德森建立类似于CVS的CVS_BRANCH标记时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经迁移从CVS到混帐。使用我们的哈德森构建脚本保存在CVS_BRANCH环境变量的值所产生的与哈德森BUILD_ID打造沿以便后来的调查。

We have migrated from CVS to Git. Our Hudson build script used to save the value of the CVS_BRANCH environment variable in the generated build along with the Hudson BUILD_ID to allow for later investigation.

我无法找出哈德森(或Git的插件)$ P $如何psents当前的Git的SHA1名字提交到ant脚本,因为我无法找到任何明确的来源说,我应该看看。

I cannot figure out how Hudson (or the Git plugin) presents the Git SHA1 name of the current commit to the ant script, as I cannot locate any definite source saying where I should look.

我最好preFER不援引GIT中得到它,如果它是在环境present,但可以做的,如果这是必要的。

I'd prefer not to invoke git to get it if it is present in the environment, but can do if that is necessary.

什么我错过了?

推荐答案

原来 jGit 支持在REV-解析HEAD命令,它与&LT组合; Java的罐子=jgit ......罐子叉=真ARGS =REV-解析HEADoutputproperty =混帐。 SHA1/方式> 也正是我想要的,即得到了SHA1到Ant属性,所以我可以在以后使用它

It turned out that jGit supports the "rev-parse HEAD" command, which in combination with the <java jar="jgit...jar" fork="true" args="rev-parse HEAD" outputproperty="git.SHA1" /> did exactly what I wanted, namely got the SHA1 into an ant property so I could use it later.

这篇关于保存的Git SHA1哈德森建立类似于CVS的CVS_BRANCH标记时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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