简体   繁体   中英

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

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. Everything works fine locally within visual studio. How do I get this to work with my Jenkins build? I am getting ResolveAssemblyReferences errors. Could not locate assembly.

I don't want to use MSBuild-Integrated Package Restore if possible. I do not want to add .Nuget folder to SVN.

is it possible for Jenkins to use Automatic Package Restore? Or do I have to use Command-Line Package Restore? https://docs.nuget.org/docs/reference/package-restore

What special settings do I need set in Jenkins?

PS I have the jenkins plugin installed and I am using MS VS 2010.

Anything you can do on the command line, you can do in Jenkins. In Jenkins, you can specify multiple build steps (see the Add build step button). 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. 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).

However, in reading the latest documentation, You can do package-restore inside your Solution file. 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. I find that VisualStudio plants stuff all over the place when you do a build, and that can interfere when you try a rebuild.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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