我正在尝试让我的TeamCity服务器从NuGet中获取包,因此我不必在我的存储库中包含所有程序集.
最初一切似乎都在起作用,但是当MSBuild步骤开始时,所需的程序集/包无处可寻.
我已将我的packages文件夹添加到我的存储库,并尝试启用我的项目"启用NuGet包恢复",如下所示:
http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages
似乎都没有用.当我查看工作目录()中的packages文件夹时,它是空的,所以没有拾取包?
以下是nuget任务的日志:
[09:11:44][Step 1/2] install: Installing NuGet packages for ApplicationBoilerplate\packages.config
[09:11:44][install] NuGet command: C:\TeamCity\buildAgent\tools\NuGet.CommandLine.2.0.0.nupkg\tools\NuGet.exe install C:\TeamCity\buildAgent\work\76a8f67cab97e73b\ApplicationBoilerplate\packages.config -OutputDirectory C:\TeamCity\buildAgent\work\76a8f67cab97e73b\packages
[09:11:44][install] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script862718012095619696.cmd
[09:11:44][install] in directory: C:\TeamCity\buildAgent\work\76a8f67cab97e73b\ApplicationBoilerplate
[09:11:45][install] Process exited with code 0
Run Code Online (Sandbox Code Playgroud)
package文件夹是否应该保留为空(某种临时存储?)还是应该包含下载的包?
文件显示了这一点
/repository/downloadAll/BUILD_TYPE_ID/BUILD_SPECIFICATION
Run Code Online (Sandbox Code Playgroud)
将所有工件作为zip文件获取,但不使用REST API.REST API中有没有办法做同样的事情?Docs似乎表明存储库链接仅用于向后兼容.
我最近已经安装了TeamCity以进行持续集成,而且我在SVN中提交的任何内容进入TeamCity的队列之前.
研究了一下,我发现我需要一个Agent
构建.现在我已经创建了一个代理,但是Warning: No enabled compatible agents for this build configuration. Please register a build agent or tweak build configuration requirements.
当我尝试构建项目时仍然会出错.
我进入了我的代理页面,我新创建的代理仍在incompatible agents
列表中Unmet requirements: DotNetFramework4.0_x86 exists
(我认为这意味着我需要在我的服务器上安装这个DOtNetFramework)并且我无法删除此要求所以我想这需要添加考虑我的服务器是Windows Server 2008 R2
.
我尝试过安装,Microsoft .NET Framework 4
但没有帮助.
请有人帮忙解决这个要求错误.
提前致谢
我正在使用TeamCity作为持续集成服务器,并使用ClickOnce安装程序部署我的应用程序.我可以让安装程序运行并部署我的应用程序,但如果计算机尚未安装它或如何在ClickOnce部署中启用自动更新检查功能,我无法弄清楚如何包含.net 4.5的安装程序.我目前正在使用下面的MSBuild文件来构建我的安装程序
<Project DefaultTargets="DoPublish" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<PropertyGroup>
<Version>$(BUILD_NUMBER)</Version>
<Install>true</Install>
<InstallFrom>Unc</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Background</UpdateMode>
<ClickOnceBuildDirectory>$(MSBuildProjectDirectory)\MyProject\bin\$(Configuration)\app.publish</ClickOnceBuildDirectory>
<ClickOnceInstallDirectory>$(MSBuildProjectDirectory)\Publish</ClickOnceInstallDirectory>
<ClickOnceFinalLocation>$(env_PublishUrl)</ClickOnceFinalLocation>
</PropertyGroup>
<Target Name="DoPublish">
<RemoveDir Directories="$(ClickOnceInstallDirectory)" ContinueOnError="true" />
<MSBuild Projects="MyProject.sln" Targets="Clean;Build" Properties="ApplicationVersion=$(Version);Configuration=$(Configuration)"/>
<MSBuild Projects="MyProject\MyProject.csproj" Targets="Publish" Properties="ApplicationVersion=$(Version);Configuration=$(Configuration);InstallUrl=$(ClickOnceFinalLocation)" />
<MakeDir Directories="$(ClickOnceInstallDirectory)"/>
<Exec Command="xcopy /E $(ClickOnceBuildDirectory) $(ClickOnceInstallDirectory)" />
</Target>
</Project>
Run Code Online (Sandbox Code Playgroud) 我决定遵循"最佳实践"并且只构建我的工件一次并在我的各种构建中共享它们.所以我创建了一个只构建正确工件的主构建,然后让其他构建具有工件依赖性来导入预构建的程序集和.exe.
不幸的是,我遇到了一些问题.具有工件依赖关系的构建版本与主构建版本的版本不同.因此,主构建版本可能是2.2.11.6787,但运行测试的构建版本号为2.2.111.6787,即使它使用的版本为2.2.11.6787.这同样适用于运行完整测试套件的每晚构建.
具有工件依赖性的构建是否可以从主构建继承版本信息?
如何让TeamCity使用Powershell在构建日志中输出消息?
我正在使用TeamCity 7.1.
这是我的Powershell构建步骤:
该脚本是:
write-host "##teamcity[message 'Getting production info']"
if ($LASTEXITCODE -ne 0) {
write-host "##teamcity[message 'Production Remote Not Found: Creating Remote']"
write-host "##teamcity[message 'Pushing to Remote']"
#git push production
} else {
write-host "##teamcity[message 'write-output: Production Remote Found: Pushing to Remote']"
#git push production
}
Run Code Online (Sandbox Code Playgroud)
我在构建日志中唯一得到的是:
[17:02:58]Skip checking for changes - changes are already collected
[17:02:59]Publishing internal artifacts (1s)
[17:03:00][Publishing internal artifacts] Sending build.start.properties.gz file
[17:02:59]Clearing temporary directory: C:\BuildAgent2\temp\buildTmp
[17:02:59]Checkout directory: C:\BuildAgent2\work\7669b6a04f96908d
[17:02:59]Updating sources: agent side checkout
[17:02:59][Updating …
Run Code Online (Sandbox Code Playgroud) 我一直在尝试使用"私钥"作为身份验证方法创建一个指向Github存储库的VCS Root大约三个小时.
但当我点击"测试连接"按钮时,我收到此错误:
列表远程引用失败:com.jcraft.jsch.JSchException:无效的私钥:C:\ Users\Administrator.ssh\EC2BuildServerPrivateKey.ppk
私钥肯定存在,我甚至使用GIT扩展使用相同的密钥克隆了存储库.
当然我不是第一个尝试使用github作为VCS root的人!?我正在使用Team City 7.1.3!
任何人都可以请帮助一些事情的建议,以验证?
也许我应该使用其他一些"身份验证方法",因为这个不起作用?
有没有人知道通过TeamCity查看构建的整个源代码的方法 - Jenkins有一个很好的功能,您可以非常轻松地访问工作区.希望这可以开箱即用或通过其他方法.谢谢.
我一直想知道TeamCity如何识别它正在运行xUnit.net测试,以及它如何知道在构建步骤运行后在构建概述中添加单独的"测试"选项卡.xUnit控制台运行器是否以某种方式对此负责?
teamcity continuous-integration unit-testing xunit.net teamcity-7.0
我以前对我的解决方案的所有单元测试都包含在一个库中,并且最近被拆分了.当位于单个程序集中时,所有测试都在本地和TeamCity上传递,但是在分离时会出现版本冲突.
配置:
我有几个单元测试程序集,它们都引用了一个基本测试库.所有测试程序集都使用上面列出的NuGet包.
在开发机器上运行测试(VS 2015)时,所有测试都成功通过.
运行团队城市构建时,会引发以下错误:
System.IO.FileLoadException:无法加载文件或程序集'Moq,Version = 4.1.1308.2120,Culture = neutral,PublicKeyToken = 69f491c39445e920'或其依赖项之一.定位的程序集的清单定义与程序集引用不匹配.(来自HRESULT的异常:0x80131040)在Ploeh.AutoFixture.AutoMoq.MockPostprocessor.Create(对象请求,ISpecimenContext上下文)
在我的解决方案的任何地方都没有提到Moq 4.1.1308.2120,所以我知道它必须是AutoFixture的参考.
将AutoFixture更新为3.31.3没有任何区别.
我在所有测试程序集的app.config文件中都有以下Binding Redirect:
<dependentAssembly>
<assemblyIdentity name="Moq" publicKeyToken="69f491c39445e920" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1402.2112" newVersion="4.2.1402.2112" />
</dependentAssembly>
Run Code Online (Sandbox Code Playgroud)
我无法将我的Moq版本降级到4.1.1308.2120,因为我在测试中使用了4.2的功能.
在我看来,Team City忽略了重定向.我不知道为什么,并且尝试了这些程序集的每个版本组合,我无法让Team City成功运行测试.
teamcity-7.0 ×10
teamcity ×6
autofixture ×1
clickonce ×1
github ×1
moq ×1
msbuild ×1
nuget ×1
nunit ×1
powershell ×1
unit-testing ×1
xunit.net ×1