在哈德森,我如何获得当前版本的git commit sha? [英] In Hudson, how do I get the current build's git commit sha?

查看:120
本文介绍了在哈德森,我如何获得当前版本的git commit sha?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用Hudson和git。我们有一个构建/测试服务器,用于编译我们的项目,然后是我们需要部署的QA服务器。



我们希望获得当前构建的git commit sha并使用它会在我们的QA服务器上提交适当的部署提交。



不幸的是,似乎hudon git插件没有在环境变量中设置git commit sha(例如svn插件在SVN_REVISION中)。我们如何解决这个问题?



指针/例子会有帮助,因为我是hudson noob。

谢谢

解决方案

这显然不适用于当前版本的git插件。相反,我们将当前头部写入文件并将其保存为工件。我们可以稍后将其卷曲并获取与给定构建对应的提交ID。


We are using Hudson with git. We have a build/test server which compiles our project and then a QA server to which we need to deploy.

We want to get the current built git commit sha and use it to pull the appropriate commit for deployment on our QA server.

Unfortunately it seems that the hudon git plugin does not set the git commit sha in the environment variables (as the svn plugin does in SVN_REVISION for example). How do we get around this?

Pointer/ examples will be helpful as I am a hudson noob.

Thanks

解决方案

This is apparently not possible with the current version of the git plugin. We are instead writing current head to a file and saving it as an artifact. We can later curl it and get the commit id corresponding to a given build.

这篇关于在哈德森,我如何获得当前版本的git commit sha?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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