从 subversion 标签自动构建

发布于 2024-07-13 03:16:05 字数 533 浏览 4 评论 0原文

我正在尝试自动化工程组的构建过程。 作为自动化的一部分,我试图达到这样的程度:应用遵循某种模式的特定标签的行为将启动一个自动化过程,该过程将执行以下操作:

  • 查看源代码
  • 从template
  • 构建项目

我非常确定我可以使用 subversion 中的 post-hook 来完成此操作,但我正在尝试找出一种方法来使用 subversion hook 以外的其他方法来完成此操作。

  • 监视 subversion 存储库中的标签目录以启动我的工作流程是否有意义?
  • 是否有任何像样的工具可以帮助解决这个问题(如果可能的话,.NET 会很棒)。
  • 我最好只写一个引擎来做到这一点吗?

我的偏好:

  • 现有产品可以完成全部或部分工作
  • 如果需要进行开发工作,.NET 是更好的选择
  • 可与 Windows 一起使用(我们有一个基于 Linux 的存储库,但构建全部发生在 Windows 上)

I'm trying to automate the build process for engineering group. As part of that automation, I'm trying to get to a point where the act of applying a specific tag that adheres to a pattern will kick off an automated process that will do the following:

  • Check out source code
  • Create a build script from a template
  • Build the project

I'm pretty certain I could do this with a post-hook in subversion, but I'm trying to figure out a way to do this with something other than a subversion hook.

  • Would it make sense to monitor the tags directory in the subversion repository to kick off my workflow?
  • Are there any decent tools that help with this (.NET would be great if possible).
  • Am I better off just writing an engine to do this?

My preferences:

  • Existing product that does all or part of this
  • If development work needs to occur, .NET is preferable
  • Works with Windows (we've got a Linux based repo, but builds all occur on windows)

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

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

发布评论

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

评论(8

海夕 2024-07-20 03:16:06

我正在使用 NAnt (和 NAntContrib) 用于自动构建。 它会自动检查 subversion 存储库是否有更改,并(如果有)获取最新的源代码版本并开始构建。

我不确定现有任务是否允许完全执行您想要的操作,但也许您可以使用它作为开始,如果需要,可以使用满足您特殊需求的任务来扩展它(它是用 .NET 开发的)。

I'm using NAnt (and NAntContrib) for automated builds. It automatically checks a subversion repository for changes and (if there are any) gets the latest source code version and starts the build.

I'm not sure if the existing tasks allow to do exactly what you want, but maybe you could use it as a start and if required, extend it with tasks for your special needs (It's developed with .NET).

醉生梦死 2024-07-20 03:16:06

正如其他人所说,您需要一个持续集成服务器(CruiseControl、CruiseControl.Net、Hudson 等)。 虽然您可以处理构建脚本并提交挂钩来执行您所描述的功能,但最终您会发现您重新发明了轮子(持续集成服务器)。 没必要,有专门用于此目的的免费解决方案。

该过程将与上面描述的略有不同。
构建服务器将:

  1. 检测新的提交
  2. 检查源代码
  3. 运行构建脚本
  4. 成功构建时

添加标签 提交触发流程并创建标签,而不是触发流程的标签。 服务器通过监视 svn 存储库而不是提交挂钩来执行此操作。

查看 CruiseControl.Net 关于此主题的文档,特别是选项 tagOnSuccess 和 tagBaseUrl。 Hudson 和 CruiseControl 应该有类似的选项。

http://confluence.public.thoughtworks.org/display/ CCNET/Subversion+源+控制+块

Like the other guys said, you want a continuous integration server (CruiseControl, CruiseControl.Net, Hudson, etc). While you could work on your build script and commit hooks to do the functionality you described, in the end you'll find you re-invented the wheel (Continuous Integration Server). No need to, there are freely available solutions for just this purpose.

The process will work a bit different than you described above.
The build server will:

  1. Detect a new commit
  2. Checkout your source code
  3. Run your build script
  4. Tag on successful build

The commit triggers the process and creates the tag rather than the tag triggering the process. The server does this my monitoring the svn repository rather than a commit hook.

Check out CruiseControl.Net's documentation on this subject, specifically the options tagOnSuccess and tagBaseUrl. Hudson and CruiseControl should have similar options.

http://confluence.public.thoughtworks.org/display/CCNET/Subversion+Source+Control+Block

嘿哥们儿 2024-07-20 03:16:05

我已经使用 Hudson 完成了此操作。 在常规的 Subversion 签出槽中,我有一个主干签出:

http://dryad.googlecode.com /svn/trunk/dryad

然后,作为第一个构建操作,我有一个“执行 shell”,并在该 shell 中使用 svn 开关更改为存储库中的最新标签:

svn switch http://dryad.googlecode.com/svn/tags/'svn ls http://dryad.googlecode.com/svn/tags | tail -n 1' dryad

下一个构建步骤是 maven 的“全新安装”命令,该命令使用标记版本中的代码启动构建。

我还没有弄清楚如何让 Hudson 从最新的标记版本开始,而不是必须进行切换,但切换是有效的。 然后,您可以在更新标记目录时触发。

它是自动化的...有点拼凑,但它有效...

开关应该包含第二个 svn 命令的反引号,但必须使用 ' 因为反引号没有出现在这里。

I've done this using Hudson. In the regular subversion checkout slot I have a checkout for the trunk:

http://dryad.googlecode.com/svn/trunk/dryad

Then as the first build action, I have an "execute shell" and in that shell use a svn switch to change to the latest tag in the repository:

svn switch http://dryad.googlecode.com/svn/tags/'svn ls http://dryad.googlecode.com/svn/tags | tail -n 1' dryad

The next build step is a maven 'clean install' command that starts the build using the code from the tagged version.

I haven't figured out yet how to get Hudson to start with a latest tagged version rather than having to do the switch, but the switch works. You can then have the trigger be when the tag directory is updated.

It's automated... a bit of a kludge, but it works...

the switch should include a backtick for the second svn command but had to use ' because the backtick didn't show up here.

一念一轮回 2024-07-20 03:16:05

我喜欢 hudson - 易于设置,并且可以与 SVN 一起使用。

您可以将其配置为在每次提交上构建。

我下载了它并在一天内开始使用它进行构建。 它经历了很多调整,但我会推荐给任何人。

我也使用过巡航控制,但对此不太满意。 除了跨平台问题之外,我没有任何具体原因。

编辑

我最近在我的 hudson 构建服务器上添加了一项工作,用于侦听 google/gmail jabber 聊天。 我可以使用此机制将“常规”构建“升级”为发布构建。 我刚刚设置了一项新工作,该工作执行将私有构建升级/发布到候选版本中所需的步骤。

I like hudson - EASY to set up and works out of the box with SVN.

You can configure it to build on every commit.

I downloaded it and got started building with it within a day. It has gone through a lot of tweaks, but I would recommend it to anyone.

I have also used cruise control but am not as happy with that. I don't have any specific reasons other than cross-platform issue.

EDIT

I recently added a job on my hudson build server that listens for a google/gmail jabber chat. I can "promote" a "regular" build to a release build with this mechanism. I just set up a new job that does the steps necessary to promote/publish a private build into a release candidate.

妖妓 2024-07-20 03:16:05

听起来您正在寻找像 CruiseControl 或 Hudson 这样的持续集成构建引擎(Hudson 用 java 编写,但在 Windows 中非常容易使用)。

现在,您可以为这些工具捏造构建脚本来监视标签目录,但这会有点违反规则,因为它们旨在监视特定位置并在该位置构建项目。 如果您查看整个标签目录,您很容易就会发现所有标签都将在构建机器上检出,并且您需要一个顶级脚本来决定构建哪个标签。

对于您想要的内容,构建引擎可以监视特定位置(例如“/branches/release”)。 如果您随后合并到该分支,Hudson 将自动构建项目、归档工件并在一切成功的情况下为您创建一个标签(请参阅
Subversion 标记插件)。

我不喜欢在提交后挂钩中执行此类操作,因为它会使提交阶段花费太长时间。 然而,TeamCity 是一个源代码控制系统,它的功能完全可以做到这一点,而不会在提交时阻碍您。

我推荐 Hudson 为此。

Sounds like you're after a continuous integration build engine something like CruiseControl or Hudson (hudson's written in java but is VERY easy to use in windows).

Now you could fudge your build scripts for these tools to watch the tags directory, but that would be a little against the grain as they're intended to watch a specific location and build the project at that location. If you watch the whole tags directory, you could easily end up with all the tags would be checked out on the build machine and you'd need a top level script to decide which tag to build.

For what you want, a build engine can watch a specific location (say '/branches/release'). If you then merge into that branch, Hudson will automatically build the project, archive the artifacts and create a tag for you if it was all successful (see the
Subversion Tagging Plugin).

I don't like doing this sort of thing from a post-commit hook because it makes the commit phase take too long. However, TeamCity is a source control system that has a feature that does exactly that without holding you up whilst it commits.

I'd recommend Hudson for this.

你列表最软的妹 2024-07-20 03:16:05

CruiseControl.Net 可以轻松地从 Subversion 存储库实现自动构建的自动化。

它可以监视存储库(Svn 和其他几种类型)并使用各种工具启动自动构建。 (NAnt、MSBuild 等)

CruiseControl.Net can easily automate automatic builds from subversion repositories.

It can monitor the repository (Svn and several other types) and start automatic builds using a variety of tools. (NAnt, MSBuild, etc.)

埖埖迣鎅 2024-07-20 03:16:05

出于此目的,本网站上已发布商业产品广告!

http://www.finalbuilder.com/Default.aspx?tabid=314

您可能需要向 SVN 添加后挂钩来触发构建开始,除非您希望它按照时间表运行。

A commercial product has been advertised on this site for exactly this purpose!

http://www.finalbuilder.com/Default.aspx?tabid=314

You may need to add a post-hook to SVN to trigger the build start unless you want it to be run a time schedule.

爺獨霸怡葒院 2024-07-20 03:16:05

我还为此推荐 Hudson。 我想做类似的事情,创建一个标签并开始构建。 相反,我选择为 hudson 使用此插件:

http://wiki.hudson-ci .org/display/HUDSON/Release+Plugin

并使用它来驱动标签的创建和显式发布版本。

I'd also recommend Hudson for this. I was looking to do something similar, create a tag and have that kick off a build. Instead I opted to use this plugin for hudson:

http://wiki.hudson-ci.org/display/HUDSON/Release+Plugin

And use this to drive creation of the tag and an explicit release build.

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