4

Our build plans for Sitecore (.Net) websites are currently using Bamboo as the build plan master for continuous integration process. Bamboo supports building a .Net project, and that .Net project contains references to several Sitecore binaries.

I have used NuGet as an artifact repository, mostly because that seemed to be the one most people were using.

So, now that I have a nuget repository, am hosting my own feed, and have added the Nuget package to my project (I just installed the package of binaries I created), what more do I need to do?

Should the build call out something special, or am I done? I guess I'm just nervous that bamboo isn't talking directly to my repository....

In the closest analogy I have, namely a Maven/Archiva combo, the maven plan specifically references the artifacts in archiva, pulling the correct version as needed. Does NuGet do this?

Affable Geek
  • 465
  • 1
  • 9
  • 19

3 Answers3

9

Since there have been some new developments in the NuGet package restore approach, I thought I'd post an update on this topic. We're using Visual Studio 2012. I wanted to be able to run MSBuild and make sure that it would first restore NuGet packages without setting "Package restore" to true in the config. Here's what I did (inspired by https://stackoverflow.com/a/23935892/414376):

  1. Upgraded NuGet in my solution to a version later than 2.7 (2.8.3 in my case; this seems like an optional step)
  2. Installed NuGet.exe on the build server
  3. Added NuGet.exe to my remote agent so that it could be run as a command from Bamboo
  4. Added the NuGet command to my build plan with argument restore (so that the command will be nuget restore); I've placed it right before my MSV Build task.

That was all I needed to get this to work properly according to the latest guidelines.

Community
  • 1
  • 1
Pascal Lindelauf
  • 4,782
  • 4
  • 40
  • 55
  • Hi Pascal, a little late to make a comment to this one now that I am needing some help in getting nuget packages out on the build server. The build server has 2019 VS installed, and I have asked the administrator to install nuget.exe on the build server. Once he installs it, all I need to do is to create a command task that would run right before the MSBuild task, correct? I don't think I quite understood what you meants on adding a neget.exe to the remote agent. I believe when I create a command task, I see Nuget an option already...it could be this wasn't available in 2017 but now it is. – bladerunner Jun 23 '20 at 19:00
  • Hi @bladerunner. It's been quite a while since I've worked on this project. And I'm not with that organisation anymore. So I'm afraid I cannot help you any further other then saying that it is indeed very likely that things work a bit differently with the latest versions of the tools. – Pascal Lindelauf Jun 25 '20 at 07:44
  • Hi @Pascal, not a problem. I was able to figure this out after working with somebody on the team. Thanks for the reply. – bladerunner Jun 30 '20 at 20:25
6

Nuget 1.4+ supports "Package restore" which embeds a call to an MsBuild task in the project file. When the packages are not available it will automatically restore them while building the project.

Filip De Vos
  • 11,568
  • 1
  • 48
  • 60
0

I'm sure this is old news, but my packages are in \packages. No amount of "dotnet restore" would work, until I explicitly mentioned the packages folder.

dotnet restore --packages .\packages

restored them!

VS2019. just in case it's version specific.

James Joyce
  • 1,694
  • 18
  • 20