Reputation: 4226
I'm trying to create a plan on Bamboo Cloud (not Bamboo Server) for a .Net project:
1) and 3) is easy, but I can't figure out how to create tasks that run Nuget and NUnit. It seems you first have to install the executables on the build agent. I found documentation on how to do this for Linux, but not for Windows.
How do I create Nuget and NUnit tasks with Bamboo Cloud?
Upvotes: 1
Views: 253
Reputation: 1212
I did this by splitting up my Job into 4 tasks:
As you would expect. It's the default task within a job anyway.
A one-liner Powershell inline script with
Invoke-WebRequest -Uri 'http://nuget.org/nuget.exe' -OutFile '.\nuget.exe'
This approach now seems to be the "new" recommended approach, so it's a simple CMD file that executes
nuget.exe restore
Using the .SLN file as parameter for the Project File option in the task and passing any needed other msbuild options in the Options field
My Bamboo server is on Linux and my remote agent is on the Windows build machine.
In your case you would follow up with the 5. task, e.g. the Nunit tests - though you may decided to put that into a separate stage, and split the tests into jobs that can run in parallel.
Edit: almost forgot: I also have a Nuget.config file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<!-- Allow NuGet to download missing packages -->
<add key="enabled" value="True" />
<!-- Automatically check for missing packages during build in Visual Studio -->
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="Syncfusion" value="http://nuget.syncfusion.com/xamarin/" />
</packageSources>
<!-- Used to specify which one of the sources are active -->
<activePackageSource>
<!-- this tells only one given source is active -->
<add key="NuGet official package source" value="https://nuget.org/api/v2/" />
<!-- this tells that all of them are active -->
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
Upvotes: 1