Build 将FAKE与Nuget私有提要一起使用
我的构建脚本中有以下目标,当我针对包的nuget提要时,它似乎可以工作,但我的组织使用artifactory,并且有一个需要凭据的私有提要Build 将FAKE与Nuget私有提要一起使用,build,nuget,artifactory,f#-fake,Build,Nuget,Artifactory,F# Fake,我的构建脚本中有以下目标,当我针对包的nuget提要时,它似乎可以工作,但我的组织使用artifactory,并且有一个需要凭据的私有提要 Target "RestorePackages" (fun _ -> "./**/*.sln" |> RestoreMSSolutionPackages (fun p -> { p with Sources = "https://prd-artifactory.jfrog.c
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" })
)
我需要能够将用户名/密码传递给此目标,以便在TeamCity上运行此操作,并传递要使用的凭据
NuGet文档声明您可以运行以下操作:
NuGet.exe Sources Add -Name <feedName> -Source <pathToPackageSource> -UserName xxx -Password <secret>
NuGet.exe Sources Add-Name-Source-UserName xxx-Password
但是我不知道如何在我的目标构建脚本中使用它。您提到的Nuget source命令允许设置访问给定包源的凭据。
凭据将按以下方式添加到nuget.config文件:
<packageSourceCredentials>
<feedName>
<add key="Username" value="user" />
<add key="Password" value="...encrypted..." />
</feedName>
</packageSourceCredentials>
只需确保您在所引用的nuget.config文件中具有凭据,并且该文件应能正常工作。我认为TC有预验证的URL。(包含url中的登录数据)已发生更改,因为我找不到“ConfigFile”的属性