版本号控制的想法
以下是我们正在研究的开发环境:
- 主要是 .NET(主要是 C#)
- 在 Visual Studio 2008 中进行开发
- SVN 中的源代码控制(VisualSVN 服务器、Tortoise 客户端)
- 使用由 Rake 脚本控制的 MSBuild/MSDeploy 进行部署
我们想要开始拥有什么是对部署中版本号的某种跟踪。这里的主要原因是非开发人员能够查看生产系统上的某些内容,并至少知道是什么源代码控制版本生成了它,跟踪我们的票务系统中的版本号等。
我的第一个想法是标记每个程序集在构建时(我想是通过 Rake 脚本)使用 Major.Minor.Build 版本号方案。我们可以在Rake脚本中手动设置Major和Minor,这些不会经常改变,并使用当前的SVN修订号作为Build。
有更好的方法吗?从旧主干版本的标签构建版本号是否会变得混乱?对此事有什么想法或建议吗?也许某个地方已经有一个工具可以很好地做到这一点?
Here's the development environment we're looking at:
- Primarily .NET (C# mostly)
- Development in Visual Studio 2008
- Source control in SVN (VisualSVN server, Tortoise client)
- Deployments with MSBuild/MSDeploy controlled by Rake scripts
What we'd like to start having is some kind of tracking of version numbers in deployments. The main reasoning here is for a non-developer to be able to look at something on the Production systems and know at least what source control revision produced it, track version numbers in our ticketing system, etc.
My first thought is to stamp every assembly at build time (via the Rake script, I would imagine) with a Major.Minor.Build version number scheme. We can manually set Major and Minor in the Rake script, those won't often change, and use the current SVN revision number as the Build.
Is there a better way to do this? Will the Build number get muddled by building from a tag of an older trunk revision? Any thoughts or advice on the matter? Maybe there's a tool somewhere that already does this rather well?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您已经在构建中使用了 rake,我想指出 Albacore 框架,它使得在构建时对程序集进行版本控制变得非常容易。
http://github.com/derickbailey/Albacore
我们为 rake 提供了一个“assembleinfo”任务,允许您可以指定所需的任何程序集级别属性 - c# 或 vb.net。例如:
您可以在其中看到
asm.version
,设置版本号。使用变量来设置它而不是硬编码的字符串值非常容易。asm.version = "1.2.3.#{svnrevision}"
还有一个 msbuild 任务,它使调用 msbuild 变得非常容易,此外还有大约 20 个任务。请参阅 github 上的 wiki 页面以获取完整列表。
有关 albacore 的更多信息,请参阅以下资源:
since you're already using rake for your builds, i'd like to point out the Albacore framework which makes versioning your assemblies at build time really easy.
http://github.com/derickbailey/Albacore
we provide an "assemblyinfo" task for rake that allows you to specify any assembly level attributes that you want - c# or vb.net. for example:
you can see the
asm.version
in there, setting the version #. it would be really easy to use a variable to set this instead of a hard coded string value.asm.version = "1.2.3.#{svnrevision}"
there is also an msbuild task which makes calling msbuild really easy, and about 20 more beyond that. see the wiki page on github for a complete list.
for more info on albacore, see these resources: