配置 Hudson 构建 git 分支

发布于 2024-12-03 08:19:16 字数 534 浏览 5 评论 0原文

背景:我们最近向 git 项目添加了一个分支以支持新功能的开发。我们将这个分支称为newfeature。对于本地开发,我们继续使用相同的代码目录结构,只需使用 git checkoutbranchname 语法在 masternewfeature 之间切换。一切都很好。

现在来说说问题。在 Hudson (2.1.1) 中使用 git 插件 (2.1.0_1) 将其配置为仅轮询并构建新功能会导致错误:无事可做。配置看起来非常简单,像往常一样插入 git 存储库 url,然后只需在“要构建的分支”字段中指定 newfeature 即可。我知道 git 插件有很多高级选项,但目前还不清楚是否有任何选项可以解决这个问题。我什至使用了高级合并选项设置,但无济于事。

我们不想做任何华而不实的事情,我们不需要构建然后推送并合并回存储库。我们只是想要一个单独的 Hudson 项目来轮询和构建 newfeature git 分支。

我缺少什么?

Background: We recently added a branch to a git project to support development of a new feature. We'll call the branch newfeature. For local development we continue to use the same directory structure for code, simply switching between master and newfeature with the git checkout branchname syntax. All is well and good.

Now for the problem. Using the git plugin (2.1.0_1) in Hudson (2.1.1) configuring it to poll and build only the newfeature results in ERROR: Nothing to do. Config seemed quite simple, plug in the git repository url as usual and then simply specify newfeature in the Branches to build field. I know that there are a lot of Advanced options for the git plugin but it isn't immediately clear that any would resolve this problem. I've even played with the advanced Merge options settings to no avail.

We aren't trying to do anything flashy, we don't need to build and then push and merge back to the repo. We simply want to have a separate Hudson project that polls and builds only the newfeature git branch.

What am I missing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栀梦 2024-12-10 08:19:16

如果您在 Windows+Cygwin 上运行,则在使用 Git 时需要小心您的环境。或者至少是 Cygwin 提供的 Git 版本。

我们注意到我们的 CYGWIN 环境变量被设置为“tty”。这似乎会导致各种 git 命令出现问题,最明显的是我们的 gitbranch 和 git rev-parse。

例如,在 Windows 命令提示符下运行 gitbranch 时,我们会看到以下行为:

C:\gittest>git branch
* master

C:\gittest>set CYGWIN=tty

C:\gittest>git branch

C:\gittest>

请注意,设置 CYGWIN=tty 后,gitbranch< /code> 命令不再返回任何输出。

因此,如果您在 Windows 上运行 Hudson,并使用 Cygin 中的 Git,请检查是否设置了 CYGWIN 环境变量。 Hudson 允许您配置构建时环境变量,以防您需要覆盖系统范围的设置。

If you're running on Windows+Cygwin, you need to be careful with your environment when using Git. Or at least the version of Git supplied with Cygwin.

We had noticed that our CYGWIN environment variable was set to "tty". This appears to cause problems with various git commands, most noticeably for us git branch and git rev-parse.

For example, when running git branch at the Windows command prompt, this is the behavior we were seeing:

C:\gittest>git branch
* master

C:\gittest>set CYGWIN=tty

C:\gittest>git branch

C:\gittest>

Notice that after setting CYGWIN=tty, the git branch command no longer returns any output.

So, if you're running Hudson on Windows, and using Git from Cygin, check to see if you have your CYGWIN environment variable set. Hudson allows you to configure build-time environment variables, in case you need to override a system-wide setting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文