【问题标题】:Using FAKE with Nuget private feed将 FAKE 与 Nuget 私人供稿一起使用
【发布时间】:2015-04-20 21:35:38
【问题描述】:

我的构建脚本中有以下目标,当我将 nuget 提要作为包的目标时,它似乎可以工作,但我的组织使用人工制品并且有一个需要凭据的私有提要。

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> 

但我不确定如何在目标的构建脚本中使用它。

【问题讨论】:

  • 我认为 TC 有预先认证的 url。 (其中包含url中的登录数据)
  • 发生了一些变化,因为我找不到“ConfigFile”的属性fsharp.github.io/FAKE/apidocs/…

标签: build nuget artifactory f#-fake


【解决方案1】:

您提到的 Nuget 源命令允许设置凭据以访问给定的包源。
凭据以下列方式添加到 nuget.config 文件中:

<packageSourceCredentials>
    <feedName>
        <add key="Username" value="user" />
        <add key="Password" value="...encrypted..." />
    </feedName>
</packageSourceCredentials>

只需确保您在所指的 nuget.config 文件中拥有凭据,它应该可以工作。

【讨论】:

    猜你喜欢
    • 2019-07-06
    • 1970-01-01
    • 1970-01-01
    • 2015-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-30
    • 1970-01-01
    相关资源
    最近更新 更多