Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I integrate NuGet into my Bamboo Build Plan?

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?

like image 531
Affable Geek Avatar asked Dec 06 '22 17:12

Affable Geek


2 Answers

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.

like image 79
Pascal Lindelauf Avatar answered Dec 30 '22 15:12

Pascal Lindelauf


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.

like image 39
Filip De Vos Avatar answered Dec 30 '22 15:12

Filip De Vos