Closed josemaia closed 6 years ago
What sources do you have specified for DotNetCoreRestore?
I am not using DotNetCoreRestore, as this is a .NET Core 2.0.0 project. I attempted to add it, and add "--no-restore" to DotNetCoreBuild, but the problem still ocurred.
Should I do this, but without specifying source on Restore?
Also .NET CLI doesn't handle encrypted credentials so you'll need to specify to store as plain text https://cakebuild.net/api/Cake.Common.Tools.NuGet.Sources/NuGetSourcesSettings/E1D7BE8B
Task("Restore")
.IsDependentOn("Clean")
.Does(() => {
DotNetCoreRestore("./OMNIA.sln");
});
Task("Build")
.IsDependentOn("Restore")
.Does(() => {
var buildSettings = new DotNetCoreBuildSettings
{
Configuration = configuration,
ArgumentCustomization = args=>args.Append($"--no-restore /p:Version=\"{version}\"")
};
DotNetCoreBuild("./OMNIA.sln", buildSettings);
});
With this strategy, the build passed (it's failing elsewhere but that's my fault! :) )
With .NET Core 2.0, it shouldn't be necessary to do a manual restore first, though, right? Does this seem like Cake's or dotnet's fault? I can close the issue if you suspect dotnet.
Well Cake only shells out to the tools, if you launch Cake with diagnostic verbosity you'll see the command line used by Cake and could try the same in a console.
Manual restore made the problem not happen anymore.
What You Are Seeing?
DotNetCoreBuild is only using the default nuget package source, even though my cake script explicitly adds a new source.
What is Expected?
DotNetCoreBuild should search all available package sources in the global nuget config, as there is no local one.
What version of Cake are you using?
0.21.1
Are you running on a 32 or 64 bit system?
64-bit
What environment are you running on? Windows? Linux? Mac?
Linux (Ubuntu 16.04 LTS) inside a Docker host that is also on Ubuntu 16.04
Are you running on a CI Server? If so, which one?
TeamCity
How Did You Get This To Happen? (Steps to Reproduce)
I add, on build start, the credentials to access a private nuget source to my global config. Upon invoking the build, only the default NuGet server is loaded.
There is no NuGet.Config file in the repository.
Output Log
This is the TeamCity execution log.
https://gist.github.com/josemaia/429c3483f9f395f50feb87ed3c67dd7d
Any builds ran after this display the new feed as having been successfully added, i.e.:
A verbose execution log is also available here, but it is a manual execution, not via TeamCity: https://gist.github.com/josemaia/94aef12b6a3d53a7826272b5041359cc