简体   繁体   English

使用SVN在Jenkins Build中进行NuGet包还原

[英]NuGet Package Restore in Jenkins Build using SVN

I've tried following the documentation with no luck. 我试过没有运气跟踪文档。
http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages http://docs.nuget.org/docs/reference/package-restore http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages http://docs.nuget.org/docs/reference/package-restore

I do not want to commit my packages folder to SVN and I am trying to get the package restore to fire in Jenkins but am unsure how to do so. 我不想将我的包文件夹提交到SVN,我试图让Jenkins中的包还原,但我不确定如何这样做。 Everything works fine locally within visual studio. 视觉工作室内的一切都很好。 How do I get this to work with my Jenkins build? 如何使用我的Jenkins构建工具? I am getting ResolveAssemblyReferences errors. 我收到ResolveAssemblyReferences错误。 Could not locate assembly. 找不到装配。

I don't want to use MSBuild-Integrated Package Restore if possible. 如果可能,我不想使用MSBuild集成包还原。 I do not want to add .Nuget folder to SVN. 我不想将.Nuget文件夹添加到SVN。

is it possible for Jenkins to use Automatic Package Restore? Jenkins是否可以使用自动包恢复? Or do I have to use Command-Line Package Restore? 或者我是否必须使用命令行程序包还原? https://docs.nuget.org/docs/reference/package-restore https://docs.nuget.org/docs/reference/package-restore

What special settings do I need set in Jenkins? 我需要在Jenkins中设置哪些特殊设置?

PS I have the jenkins plugin installed and I am using MS VS 2010. PS我安装了jenkins插件,我正在使用MS VS 2010。

Anything you can do on the command line, you can do in Jenkins. 您可以在命令行上执行任何操作,您可以在Jenkins中执行。 In Jenkins, you can specify multiple build steps (see the Add build step button). 在Jenkins中,您可以指定多个构建步骤(请参阅“ 添加构建步骤”按钮)。 To do a package-restore from the command line just as you can do from your own box. 要从命令行执行包恢复,就像在自己的框中一样。 Select Execute Windows Batch command from the drop down menu. 从下拉菜单中选择“执行Windows批处理”命令。 You can reorder build steps when you have more than one. 如果有多个步骤,可以重新排序构建步骤。 There's a tiny handle next to the build step's description (ie where it says Execute Windows batch command above the field where you can specify the Windows commands). 在构建步骤的描述旁边有一个小手柄 (即在可以指定Windows命令的字段上方显示执行Windows批处理命令)。

However, in reading the latest documentation, You can do package-restore inside your Solution file. 但是,在阅读最新文档时,您可以在解决方案文件中执行package-restore This would be preferable. 这将是更可取的。 Also, use your version control's ignore option to ignore the folder where you download these packages. 此外,使用版本控制的忽略选项忽略下载这些包的文件夹。 This way, no one will accidentally check in the downloaded packages into version control. 这样,没有人会不小心将下载的包检入版本控制。

Under the Jenkins Source Code Management Section, use either " Emulate a clean checkout by first deleting unversioned/ignored files, then 'svn update' ", or if that doesn't work " Always checkout a clean copy " under Source Code Management. 在Jenkins 源代码管理部分下,使用“ 通过首先删除未版本控制/忽略的文件来模拟清理结账,然后'svn更新' ”,或者如果这不起作用“源代码管理”下的“ 始终检出干净副本 ”。 I find that VisualStudio plants stuff all over the place when you do a build, and that can interfere when you try a rebuild. 我发现当您进行构建时,VisualStudio会在整个地方植入东西,并且在您尝试重建时会产生干扰。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM