I have the following Target in my build script and it seems to work when I target the nuget feed for packages but my organization uses artifactory and has a private feed that requires credentials.
Target "RestorePackages" (fun _ ->
"./**/*.sln"
|> RestoreMSSolutionPackages (fun p ->
{ p with
Sources = "https://prd-artifactory.jfrog.com:8443/artifactory/api/nuget/some-private-feed" :: p.Sources
OutputPath = "./packages"
Retries = 4
ConfigFile = Some "./.nuget/nuget.config" })
)
I need to be able to pass in the username/password to this Target so I can run this on TeamCity passing in the credentials to use.
NuGet documentation states that you can run the following:
NuGet.exe Sources Add -Name <feedName> -Source <pathToPackageSource> -UserName xxx -Password <secret>
But I am not sure how to use this in my build script for the Target.