- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 Nant 构建脚本,CruiseControl 使用它来按需构建解决方案。
但是,我们最近才获得 CruiseControl,因此我们的官方内部版本号与 CruiseControl 中列出的不同。
我知道 CruiseControl 将一些属性注入(inject)到构建脚本中,以便我可以在脚本 (CCNetLabel) 中访问 CC 内部版本号,但是如何将值传递回 CC 以用作 UI 屏幕上的内部版本号?
例如,CC 表示内部版本号 2
nAnt 脚本每次构建都会增加一个 buildnumber.xml 值,官方的构建号是 123。
我希望 CC UI 显示最后一个成功的内部版本号:123,而不是 2,那么我如何将该值传递回来?
最佳答案
为此需要自定义构建标签。 Perforce 是我们的源代码控制提供商,我们从中获得了我们的版本号。代码如下:
/// <summary>
/// Gets the latest change list number from perforce, for ccnet to consume as a build label.
/// </summary>
[ReflectorType( "p4labeller" )]
public class PerforceLabeller : ILabeller
{
// perforce executable (optional)
[ReflectorProperty("executable", Required = false)]
public string P4Executable = "p4.exe";
// perforce port (i.e. myserver:1234)
[ReflectorProperty("port", Required = false)]
public string P4Port = String.Empty;
// perforce user
[ReflectorProperty("user", Required = false)]
public string P4User = String.Empty;
// perforce client
[ReflectorProperty("client", Required = false)]
public string P4Client = String.Empty;
// perforce view (i.e. //Dev/Code1/...)
[ReflectorProperty("view", Required = false)]
public string P4View = String.Empty;
// Returns latest change list
public string Generate( IIntegrationResult previousLabel )
{
return GetLatestChangelist();
}
// Stores latest change list into a label
public void Run( IIntegrationResult result )
{
result.Label = GetLatestChangelist();
}
// Gets the latest change list
public string GetLatestChangelist()
{
// Build the arguments to pass to p4 to get the latest changelist
string theArgs = "-p " + P4Port + " -u " + P4User + " -c " + P4Client + " changes -m 1 -s submitted " + P4View;
Log.Info( string.Format( "Getting latest change from Perforce using --> " + theArgs ) );
// Execute p4
ProcessResult theProcessResult = new ProcessExecutor().Execute( new ProcessInfo( P4Executable, theArgs ) );
// Extract the changelist # from the result
Regex theRegex = new Regex( @"\s[0-9]+\s", RegexOptions.IgnoreCase );
Match theMatch = theRegex.Match( theProcessResult.StandardOutput );
return theMatch.Value.Trim();
}
}
<project>
<labeller type="p4labeller">
<client>myclient</client>
<executable>p4.exe</executable>
<port>myserver:1234</port>
<user>myuser</user>
<view>//Code1/...</view>
</labeller>
<!-- Other project configuration to go here -->
</project>
关于version-control - 如何将内部版本号从 Nant 传递回 Cruise Control,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/268289/
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我在巡航控制配置文件中创建了一个变量 我想稍后在执行过程中更改巡航控制中此变量的值。基本上我想要的是在执行任务 1 时,“MyVariable”的值应该是“val1”,而在执行任务 2 时,值应该是“
我有控制台应用程序,它在构建期间启动一些测试。 Tests.exe Q:\Software\Platform\ 100 我想将它的输出重定向到文本文件,然后将其包含在我的报告文件
我的团队的目标是最大限度地减少我们的构建被破坏的时间。 我们使用 CruiseControl.NET 进行持续集成。我想知道如何最好地回答以下问题: “在过去的 {timespan} 中,{proje
我有一个使用 CruiseControl.NET 的项目,作为版本控制方案,我们有 3.0.[ccnetbuild].[svnrevision]。 CCNetBuild 是内部构建号巡航控制,用于跟踪
我目前有一个代码库,其中将 NUnit 测试组织成套件。我们目前在 CC 盒上有一个构建任务,它运行一个 CC 项目中的所有测试。 有没有一种方法可以配置 CC.Net 以允许我们从仪表板单独运行不同
我正在组合一堆应用程序来为 Microsoft 平台创建自动构建(我选择的产品和我将构建的软件都在 Windows 上运行)。我选择的产品是: 代码库:SubVersion 持续集成:CruiseCo
我已经下载了 cruisecontrol.net 安装程序并将其安装在 "C:\Program Files\CruiseControl.NET" 中。 它包含一个名为 “webdashboard” 的
我已经配置和测试 CCNet 一段时间了,现在使用 Virtual PC 来托管它。一切都很顺利,并决定将配置转移到服务器位置 - 这与预期的一样好。一些调整和踢,我让它像以前一样运行。 问题是我们现
我设法搞砸了我的 Cruise Control 项目。 在移动到新的源代码管理主机时,我正在更新持续集成服务器上项目存储库的 Git URL。我有点高兴地剪切和粘贴并将错误的存储库 URL 粘贴到源中
我有一个 Nant 构建脚本,CruiseControl 使用它来按需构建解决方案。 但是,我们最近才获得 CruiseControl,因此我们的官方内部版本号与 CruiseControl 中列出的
我们正在运行 Cruise Control 1.5.7256.1 并使用它使用 Nant 和 Nantcontrib 进行构建。构建正确地失败和成功,但是当它们失败时,相关的错误消息将显示在 CCNe
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 4 年前。
我正在寻找一种从 subversion post-commit 钩子(Hook)触发 Cruise Control.net 构建的方法。 我希望这样做是为了在提交后直接开始构建。 我知道这样做的正常方
我为 Cruise Control 配置了一个任务来运行一个运行 MSTest 套件的 NAnt 脚本。 MSTest 允许我指定测试类别,所以我想指定“!Integration”(这意味着“不运行集
我使用 CruiseControl.NET 自动构建我的 .NET 3.5 Web 应用程序,这很好用。但是,有没有办法自动创建这些构建的 ZIP 文件,并将 ZIP 放入单独的目录中? 我已经看到使
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
当我尝试从 MSBUILD 构建解决方案文件时收到以下错误。 我正在从 ClearCase 集成流构建解决方案文件。 当我从不同的系统执行相同的操作时,它在集成流中运行良好。 我已尝试创建文件并将其写
我目前已经安装了 CC.Net 来进行构建,它很棒。但现在我想一路走下去,并将其用于部署。我正在考虑在暂存时安装 CC.Net,在构建完成后,它会自动上传 forcebuild 触发器到暂存,并让它使
当使用 Cruise Control 通过单元测试构建 iPhone XCode 项目时,会生成“代码签名错误:找不到与应用程序标识符“com.yourcompany.Calculator”匹配的有效
我是一名优秀的程序员,十分优秀!